One big mistake that I did when I first started playing poker was not to have a goal in mind. I can see now that if I would have placed a cake in the horizon I would have had far greater success in the early stages of my poker career.
The chapter Building Your Bankroll in the book High Stakes Poker: The Sky is the limit by Doug Youngs covers the whole idea. The goal of this is to get your focus on the main part of poker - the long run is what counts.
A great way to is to take 10% of all your winnings and place it on a seperate bank account. You can see those 10% as an insurance fund wich you will only use in case of emergency. You will then notice how your bankroll will grow even though you have bad sessions for days, weeks or even months!