Q: How do I Write a riff on my guitar
A: try thinking of a story that the riff will be used for. Even if you don't actually think of a story, sometimes that will trigger your brain into thinking of a riff anyway