Count to the sixth letter
C, D, E, F, G, A make six letter names. C–A♭ and C–A are both sixths.
Eight or nine semitones
C–A♭ is a minor sixth (m6) at eight semitones; C–A is a major sixth (M6) at nine. They are neighboring keys. You can also find the octave at twelve semitones and step back four for m6 or three for M6. C–G♯ shares a key with C–A♭ but is an augmented fifth by spelling.
Practice the relationship
Compare the two adjacent sixth targets from different roots, then find each key from its interval name.