In the OnlineGDB IDE, on the left side of the RUN button, there is a "New File" button where you can create a new file.
If you'd like to create a new file in C, look at the fopen() function (there's an example at the bottom of that page).
In C++, you should use the std::fstream::open() function (again, there's an example at the bottom of the page).
Every language has something similar functionality.
Good luck!