It sounds like you're using Windows.
- Right click on a .h or .cpp file.
- Click "Open With"
- Select "choose another app"
- Check "Always use this app..."
- Select the program you want to use to open that file type by default
- Click "OK"
The instructions will be a little different depending on Windows version (that was Windows 10) but it will be basically the same.
And no, it would make absolutely no difference for compiling code. I have no idea how it was before but you are welcome to ignore it. Notepad is a really bad text editor for code. I recommend you to get a text editor that is safe for programming and associate that program with .h, .cpp, and any other source code files that you don't already have a specific program to work with. I like Notepad++ but there are plenty other excellent options.