If what you have is the source code for a game, and you have the complete source, the process is to first figure out which programming language it's written in. From there, you run it through a compiler, which generates the necessary files for you.
That said, I don't think it'll work in your case. Without all the required supporting files and assets, you'll likely just end up creating the game's .EXE file without a functioning game behind it. Compiling source code alone usually isn't enough, you need the full project, resources, and dependencies all in place.