I downloaded UE strategy game sample for study c++ codes but some codes are highlighted red.

Anyone knows how to fix them or is it a crucial thing. I just want to study the coding logic. (i am beginner)

It’s not really a big deal; Visual Studio often displays several false errors for Unreal Engine. See if this guide on Removing red squiggles (Intellisense errors) for Unreal Engine · GitHub helps you.