As any computer programmer will tell you, we learn languages by example. The best way to learn to make a program is to see how someone else did it. Then you try what they did and get it working. Once there, you can add bits of functionality and play with syntax and function to understand the language bit by bit. Each program needs certain abilities, such as collecting information (input) and returning an answer (output). It's just a matter of learning how this language is constructed. Creativity is built into the language, and you will find many ways to do the same task. You can make your program an expression of yourself.
Learning harmonious movement, Chinese gongfu, Chinese medicine, healthy eating, poetry or marketing is the same. Find someone you admire in the area you wish to learn and copy them while you learn. Once you have a foundation, you can improvise. Make it your own. Ask a Jazz musician about their classical training.