Reduce string to a snippet of the alphabet
JavaScript (ES6), 66 79 68 67 bytes

f=([c,...s],p)=&gt;c?(p?~parseInt(c+p,36)%37:c&lt;'!')?f(s,p):c+f(s,c):''


How?

Testing consecutive letters

Because converting two characters to their ASCII codes would be a rather lengthy operation in JS, we use the following formula instead:

~parseInt(b + a, 36) % 37


Provided that both a and b are in [a-zA-Z ], the above expression equals 0 if and only if a and b are consecutive letters (i.e. consecutive digits in base 36), no matter the case of the characters.

For instance:

~parseInt("Y" + "x", 36) = ~(36 * parseInt("Y", 36) + parseInt("x", 36))
                         = ~(36 * 34 + 33)
                         = -(36 * 34 + 33 + 1)
                         = -(37 * 34)


Formatted and commented

f = ([c,                              // c = current character
         ...s],                       // s = array of remaining characters
                p) =&gt;                 // p = previous matching letter
  c ? (                               // if there's still at least 1 character to process:
      p ?                             //   if p was already defined:
        ~parseInt(c + p, 36) % 37     //     test if p and c are NON-consecutive letters
      :                               //   else:
        c &lt; '!'                       //     test if c is a space character
    ) ?                               //   if the above test passes:
      f(s, p)                         //     ignore c and keep the current value of p
    :                                 //   else:
      c + f(s, c)                     //     append c to the final result and update p to c
  :                                   // else:
    ''                                //   stop recursion


Test cases



f=([c,...s],p)=&gt;c?(p?~parseInt(c+p,36)%37:c&lt;'!')?f(s,p):c+f(s,c):''

console.log(f("codegolf")) // -&gt; cdef
console.log(f("CodEgolf")) // -&gt; CdEf
console.log(f(" codeolfg")) // -&gt; cdefg
console.log(f("ProgrammingPuzzles")) // -&gt; P
console.log(f("Stack Exchange")) // -&gt; St
console.log(f("The quick red fox jumped over the lazy brown dog")) // -&gt; Tuvw
console.log(f("Zebra")) // -&gt; Z
console.log(f("Abcdegfhijkl")) // -&gt; Abcdef