i just want to ask, why we need to declare the header on the upper part of our syntax.

Headers provide declarations for the library objects and types you use. C++ requires a declaration to exist, and because it would be a pain (not to mention non-portable) to declare things manually, the headers are provided to make your life easier.