For many people, meditation can be a very difficult thing to achieve. It requires patience and focus. No one will get it right for the first time. Thoughts will run through your head, you'll get distracted easily, etc. Look up some guided meditations on youtube. Those work very well for first timers.
Meditation is basically just a way of clearing your mind, relaxing your body, and focusing yourself on a specific task whether it be magical or mundane. This can be done in many ways and you shouldn't feel like you have to meditate any one way. Find whatever works for you. :)
You can sit cross legged, legs outstretched, or you can even lie down. Sometimes people will have objects or rituals to help them meditate like lighting incense or candles, or using amethyst to unblock energies.
One way of meditating can be done like so:
You get in a room free of distraction and you get in a comfortable position whether you be sitting or lying down. Then, you begin to relax your limbs and you start to take deep breaths, in the nose out the mouth. You focus on keeping it steady and you allow your mind to begin clearing.
When clearing your mind, if a thought keeps bothering you address it for a moment and then let it slip away. This may happen often especially if you're stressed about something but don't completely ignore it just acknowledge it and then let it go. If you have a specific intention in mind begin thinking about it and allow yourself to focus on it. Keep your breathing steady too.
You tend to just know when you're through meditating. You may feel very at peace and/or relaxed, and you may be motivated and focused to do a task you want to finish. I normally meditate for about ten to fifteen minutes but some people like to go to thirty minutes to even an hour. It is up to you to decide how long you meditate for.
To add to the above, if you are having trouble focusing while meditating, try listening to relaxing music or a guided meditation tape (both can be found on YouTube). Make sure you're in a comfortable position--if you want, you can lie down, as long as you don't fall asleep. Burning incense while meditating can help you relax, as can drinking something warm beforehand or taking a warm shower/bath. Meditating right after you get out of bed or right before you go to sleep can also be easier. I often take a walk beforehand, to get excess energy out.