Modulation, simply put, is a change of key. This can be done a number of ways - there is no "set" way to go about doing it. You can use pivot chords or just jump right into the new key.
Pivot chords are usually the smoothest way to go about modulation, since it's a gradual change and not a sudden punch in the face (although, there are plenty of smooth direct modulations I can think of). For instance, if you're in the key of C and you want to modulate to the key of G, the only difference in key is the F becomes F#. Any chord that doesn't use an F or an F# is shared between those two keys: C, E-, G, and A-. Use any of these to pivot between the two keys, then bring the F# in and it won't sound so abrupt. Using the A- as a predominant to D7 (dominant of the key of G) is a very smooth and strong cadence into the new key.