Did you #include "Arduino.h" at the top of your code? That would cause the red, wiggly, underlines which I think you mean when you say “marked as a problem”.
Even if you do have that #include present, VSCode (which I assume you are using) can sometimes lose the plot as far as “intellisense” is concerned. It’s intellisense, from Microsoft, which does the squiggly lines when it doesn’t understand something.
You can force it to reread the source files by:
View->Command Palette (or CTRL-SHIFT-P)
Search for intellisense
Choose PlatformIO rebuild intellisense index.
If that doesn’t help, try again, but this time, select “C++ Rebuild Intellisense index”.
Those options usually help. However, it can also be ignored. I have noticed in quite a few projects, that intellisense sees some of the Arduino code as ok, but gives me squiggles for others.