There are plenty of books available which will help you learn techniques to better control your thoughts.
The first one I read, The Secret, was a good starter.
I've read several more since then.
Some of the better authors in this field are Wallace Wattles, Napolean Hill, Wayne Dyer, Jack Canfield, Charles Haanel, Michael Beckwith, Bob Proctor and Rhonda Byrne, author of The Secret.