Play only as fast as your hand will let you without messing up.
If you mess up you're playing too fast.
Slow down. Play each fret with its corresponding finger (i.e. 4th fret is 4th finger, 3rd fret is 3rd finger and so on and so forth) also play with alternate picking. Play at a pace where you don't mess up then if you successfully play it at that pace speed up some.