Hi @Kiran
I understand your problem - as an learner its quite difficult to understand which files needs to add/edit to add custom fields.
Well starting from basic - in magento 2 you can customized/extend module using many ways like using plugins , using events observers , overriding module , creating your custom module as well !
so based on the situation and customization required you need to choose options for that.
Coming back to your exact question - you can create a custom module in app/code directory of magento 2 root directory.
Here i am sharing a link which gives you exact insight how to create a custom module and how to add custom fields in contact form page - https://magenticians.com/add-custom-field-in-magento-2-contact-page/
I have choose contact page example for you because as a first step its good idea to learn how to add custom field in existing forms so .
You can also refer this for the same - https://dev.to/suthanalley/how-to-add-custom-fields-to-magento-2-contact-page--3kb
Hope it helps !
if issue solved,Click Kudos & Accept as Solution