Plan it, then program it, debug it and use it.
Even with little programming knowledge you'll be more than able to make a game that uses a turn-based system.
Try it, then ask here if you get stuck with specific parts. The community is happy to help you!
Don't ask for code, that way you'll learn little to nothing. The purpose of the forums is to learn. (at least in this section)
I assume that this answer isn't what your where looking for, but believe me, it's for you own good!
As for coding it, I agree @johnwo. It would come by practice. Coding a turn-based game is easy but coding an AI is difficult, so if you have no former GML experience, please drop the idea and make simpler games first.