|Marvin the paranoid android, from The Hitchiker's Guide to the Galaxy|
So the easy answer is to keep busy: don't get into boring or frustrating situations. Find a job where you are stretched, where you can do great work all of the time, or failing that start your own business and work for yourself.
That's the easy answer.
Let's leave it there.