I´ve often got melodies in my brain and then I try to figure them out on my guitar. It´s not very easy for me, because I don´t have a good ear for hearing notes. But then I often create a different riff, which sounds great too. So maybe thats a approach for you.
Another way is to play certain...