Close Keys for Modulation
Whichever key you begin with, the closest keys to modulate to are the dominant (add one sharp or remove one flat), the subdominant (add one flat or remove one sharp) or the relative major/minor (shared key signature).
From a Major Key
Starting from a major key, when you move to a close key there will only be one note different between the scales of the two keys. In a single-line melody, this is the note you need to use, in order to achieve the modulation.
For example, if we start with Eb major and move to its dominant, Bb major, the new note is A natural (the leading note of Bb major, found in chord V).
Moving to the subdominant, Ab major, the new note is Db (7th of V7 of Ab major).
Moving to the relative minor, the new note is B natural (leading note in C minor, found in chord V).
From a Minor Key
When modulating from a minor key to its dominant, it is closer to move to the minor dominant than the major dominant. For example, modulating from A minor to E minor is simpler than modulating from A minor to E major.
Moving to the dominant minor or subdominant means moving to a minor key, so you will need to use the raised leading note which we find in the harmonic minor scale. Moving from A minor to D minor means using C# in chord V. The other note that changes is the 6th of the scale, for example Bb in D minor.
Moving to the relative major key, we need to use the dominant note of the major key. For example, when moving to C major from A minor we would need to use G natural.