In another answer to someone else I created this small project: https://onlinegdb.com/rkpBH1mkD
You can see in Online GDB that the top menu offers a "New File" menu. That's where you can create and add a new file to your current project.
You can access all your projects on the left side panel: "My Projects"
Online GDB will compile all the files for you and build (link) an executable from them and run it for you for testing.
So all you need to do is make sure the declarations (header files) are correctly included, where needed.
You did it correctly: card.h is needed in your main.
Your code should compile.
It's best to share your project and any errors you have encountered to get the right help you need.