Well the first thing you do is learn to program there are online tutorials if you can't find one then you didn't look. Now design your program and figure out what you will need to do that you don't know how to do and go learn that and make your program you will get stuck...Have fun
Start with Python, it's the easiest general purpose programming language out there and it has a very big community behind it. Here's a list of free python books: https://github.com/vhf/free-programming-books/blob/master/free-programming-books.md#python
The ones I recommend would be Introduction to Programming with python and Invent your own computer games with python.