Write a spec. What do you want your program to do? The screens (if its a UI based program) the logic, the input/output, etc. Keep the scope limited to what you can do in a reasonable amount of time (one week? one month?).
Then build it. Stick to the spec, make it work according to what the spec needs. Sure you will come across distractions, sure you will have to do some research because you have never faced a particular issue before, but you will build something you wanted to build. This is different from building something that you just 'can' build.
Once you finish, refactor your code, try to make it more efficient. Then if you think your program is still not done, start over, improve the spec, improve the code and keep doing this.
Remember, most commercial software solve a need.. it is very important to define the need, and the solution to filling that need before actually solving the problem. And as the need grows bigger and bigger, your software will grow too, over time!