Why is this important?
You need to set limits and prioritise.
There isn't enough time to do everything. So you need to focus on what's important and do that!
There isnt' the time to fix every bug. So fix the ones that cause the biggest problems or affect the most people (or whatever criteria you use to prioritse bugs) first. By the time you've made those changes, circumstances may be different.
Make sure you're adding the feature which will bring the most benefit. Not just the one that is easiest to code, or most fun.
Make sure you're creating a new program that is of use, doesn't already exist and will actually benefit others.
What do you do once you know this?
Make sure you're doing something that is worth doing.
Don't do one thing if there's another that is more important.
Understand the costs and benefits of fixing the bug, adding the feature or creating a new program, before you write the code.