Controlling your thoughts during meditation takes practice. Most people will not be successful the first few times they try and most have to experiment with different techniques to find what works best for them. One technique that many people find to be useful is to create a setting in their mind that is peaceful. Once you have decided on a setting, start putting in details.
If you are inside, determine what color the walls are and what pictures are on the walls. If you are outside, determine what sounds you hear and what the place smells like. The more details you add, the more your mind needs to focus on creating your setting and the less space your mind has for other intruding thoughts.