Musical modulation means changes of the tonal center, the key, of a composition confirmed by a cadence. It bases on scale relations. First of all, when searching for a possible modulation, from the previous key to the next one, we are interested in closely related and relative keys. Modulation can be diatonic, chromatic, and enharmonic. Chromatic and enharmonic modulation sounds quite exotic. Usually, they serve to modulate distantly related keys. But the most convenient and harmonious way to modulate is to use pivot chords of closely related keys. This method is a diatonic type of modulation.
If the previous key contains the tonic triad of the next one, they are closely related. The main feature of these keys will be a similar key signature. They differ from each other by no more than one symbol. There are always five closely related keys from the natural scale plus one from its harmonic variant.