I am using a third party module, but it doesn't fulfill all the requirements. So I have to do some customizations in this module. If I do changes directly in the third party module then it will be overridden when we update the module.

What is the best way to override this third-party module?

I have to override fronted controller file.

I am new to Magento. Please provide me some guidance.