The change of key in a composition verified by a cadence in the new key (otherwise, it is a passing modulation or touching upon a different key). As a general rule, modulations to the sharp side raises tension, modulation to the flat side lowers it. Modulations to related keys are ideally accomplished by means of 'pivot chords', i.e., a chord which is common to both the initial and the new key (like the submediant chord -vi- followed by II(#) - V when modulating to the dominant; ii-V-I in the new key); or the tonic chord itself would be the subdominant of the dominant key: I - II(#) - V would be a smooth modulation to the dominant (IV-V-I in the new key). Some other means to modulate are: circle-of-fifth progression to modulate to another degree of the scale or one-step sharp or flat, by changing the chord before the new tonic to a dominant seventh if required; changing any chord to a dominant seventh of the new tonic by adding a minor third above a major triad (like

- IV would be

- I in the subdominant key); in minor keys, the submediant is a major chord, if it is made a dominant seventh and followed by its tonic, this would be modulation to the flattened supertonic; resolving a diminished seventh on the dominant seventh of the new key and progressing to the new tonic (see diminished seventh); using an augmented sixth on the flattened submediant of the target key and resolving onto the new tonic via its dominant (like A
b - G - C) [modulation via outward resolution]; using a Neapolitan sixth to modulate to the flattened submediant (in C major, D
b chord as the Neapolitan  -IV in A
b-  followed by

 -

in A
b-  and A
b as the new tonic: IV-V-I  in the new key) or by using the D
b Neapolitan chord as the dominant of the next key (to G
b). The (major) tonic chord of the prevailing key would be the Neapolitan chord of  the new key a semitone lower (in C,  
bIb - IV - VII  would be  IVb - V - I  in B). This is another use of the Neapolitan chord to modulate a semitone lower. Direct juxtaposition of the new key is not considered to be a modulation by some.