well i say IMO to just play what you think sounds good.
It also depends on your level of playing.
if your just starting id say play chords and power chords.
that's always a good way to start off.
There's a place where a depth charge ignites.
First of all, do you know any theory? After I learned some scales I found I could write riffs A LOT easier, because I knew which notes sounded good together.

My leet rig
Schecter Hellraiser
Agile AL-3100
Ibanez RG120
Alvarez RF8
Yamaha G-55 Classical
Peavey Valveking
Vox AD15VT
Pod XT Live
Ibanez Weeping Demon
Yep, learn some theory. Lots of people say "learn the basics of theory". But personally, the basics of theory is just like learning the alphabet. It doesn't tell you HOW to apply the stuff when writing music (likewise, learning the alphabet doesn't make you understand how words are formed and spelled). Soooo, learn the basics of theory, and THEN continue on and learn the more "advanced" stuff - aka, how it's to be applied.
First you will need to have a bit of knowledge about music theory, but then you should probably sit down with your favorite music, get into it, and then write someting, maybe even "borrow" a riff or two . Just dont copy it directly. I usually write my riffs when I hear something really cool and try to emulate it.