If your chord progression contains some out of key chords you can navigate through it by writing a melody that shifts between several keys, but a more listener-friendly (not to say singer-friendly) option is to construct a tune that simply avoids any notes that clash. So if you are in the key of C major and shake things up with a D major chord (D F# A) why not avoid singing an F or an F# over that chord. Use something else from the C major scale instead. Once it's passed you can go back to the original scale as if nothing happened. That way you get the freshness of the chord change without the hassle of having to tweak the melody.
Golden Slumbers, Here Comes The Sun, I'm So Tired, Julia, Martha My Dear, There's A Place
Ticket 13: Make The Vocals Stay On Non-Chord Tones
Ticket 28: Use At Least One Out Of Key Chord
See the full list of songwriting tips here - Tickets To Write