Here are 3 patterns of an A minor pentatonic scale. Most blues and rock guitar riffs derive from these patterns. The first step is to practice and memorize them.Then you can move them into different keys by simply playing them at different frets.
The middle pattern is the most used of the 3 because it starts on the root note ( the root notes in the patterns are highlighted in red). The root note is the key that you are playing in. In this this example I’ve chosen the key of A minor but these patterns can be moved to any key by simply lining up the root notes (the red notes) on the key you want to play in. The easiest way to do this is to start with the middle pattern and play it at different places on the guitar neck. At the 5th fret it’s A minor, 3rd fret/G minor, 10th fret/D minor, 12th fret/E minor etc… (Also see below the chart of the guitar neck).
I hope this helps.