And most importantly, when you are able to play it in some sort of beat (even a really, really slow one), you need to use a metronome. It's the only way you will be able to keep a steady beat; playing in time is one of, and some say the most important (drummers usually say this), thing you can do. Practice with a clean tone, slowly, with a metronome, and it will come eventually. You gotta put in the blood, sweat and tears first.
There are only two important things in life - There's music and theres girls, not necessarily in that order....
The Ace's Guitar Tricks