Help setting up and using header files


I am a newish user and I use Platformio and VScode to amend Marlin 2.0.x files to control my 3D printer. However, when I update to a newer version of Marlin I have to change all the lines of code that I have changed in the previous version. This takes time and can lead to mistakes!

I have been told that I could use Header Files to define those variables that I have changed and that will overwrite the new Marlin vaules (including altered comment in or out???).

However, I have been looking for some guidance on how to set up the file and then ‘use’ it. I cannot find anything - possiblybecause I am searching for the wrong title…

Can anyone point me to a simple help text/video etc?
Thanks for looking at this David