A melody note can relate to a chord in three ways:
Chord Tone
Root, 3rd, 5th, or 7th of the chord. Always safe.
Available Tension
Adds color (9, 11, 13). Works on specific chord types.
Avoid Note
Clashes with a chord tone. Use only as passing tone.
Scale notes in C Major
Tap a scale note to set it as the melody note
Showing scale notes (green = selected melody note)
Diatonic chords in C Major