How to add a custom field to checkout billing and (or) shipping on the checkout, and store it in the database? This also should be stored in the user registration on their address shipping or billing details

Hello,

Please help me on adding custom field to checkout billing and (or) shipping on the checkout and store it in the database
this also should be stored in the user registration on their address shipping or billing details

Please let me know how to override the magento core to add this, maybe needs plugin implementation or something

Thanks