Make it work then optimize.
Start from small then expand.
Don't hesitate to copy code from others.
Don't just copy, understand it.
Learn various algorithms (Data Structure and Algorithms)
Lastly, touch some grass.
Don't Repeat Yourself
Single Responsibility
Utilize programming patterns (Creational, Structural, Behavioural)