I just thought I’d share this here as the errors aren’t mentioned in the lesson ( UE5 C++ Developer: Code Your Own Unreal Games, 3.9).
When I compiled the code in VSCode, I got errors relating to an inability to find header files, advising me to edit config files. Yikes!
On searching Google for a while, I discovered that refreshing VSCode from within the Unreal editor would do the trick.
In the Unreal editor, choose ‘Tools → Refresh Visual Studio Code Project’.