In OnlineGDB, the icon on the far left creates a new file. If you click it and give it a name ending with .h then you can fill the file with whatever is in the header file. Then in the main window you can add #include followed by the name of the file in double quotation marks. Something like this:
https://onlinegdb.com/Q2v1GuHdY