Playing riffs you like to understand how they are built and knowing a little bit of theory like major and minor scale helps a lot. And listening to a lot of songs you like, repeat them, check some tabs, try to understand what's going on in the music and on the neck.