Two adjacent letter names
C to D is a second because C and D are two letter names when both endpoints count. C to D♭ is still a second; the flat changes its width.
Minor and major seconds
A minor second (m2) spans one semitone; a major second (M2) spans two. C–D♭ is m2 and C–D is M2. Key color is no shortcut: E–F uses two white keys but is only one semitone.
Practice the relationship
From different roots, identify one step and two steps on the keyboard, then work backward from m2 or M2 to the target key.