Watch the Ringing Riff online guitar lesson by Rich Maloof from Guitar 201: Breakthroughs
Here’s a riff with a little more going on. The part fills a lot of space by combining chord hits, a single-note figure, and ringing open strings. You really have to do double duty to nail a riff like this, because you’re playing a melodic line but still responsible for holding a rhythm part together.
If it gives you some trouble, work first on the transition between the open Em and D chords. Then think of the other parts as lines that stitch the two chords together.