The half-diminished seventh chord is one of those chords that work well at a poignant moment, perhaps highlighting a word of text, or the climax of a phrase. It has several possible tonal functions depending on the context, but it's tritone and minor 7th anatomy makes it a sparkling color chord that deserves exploration in your own compositional process.
Diatonic Function. Most commonly, the half-diminished seventh chord functions as a predominant, that is, a ii (supertonic chord) that comes before the dominant (V) which closes a progression in the minor mode. Most common is for the third of the chord to be in the bass.
any minor key: ii half-dim 6/5 - V7 - i
The half-diminished seventh chord can also function in the dominant area, preceding the dominant (V) in the major mode.
any major key: vii half-dim 7 - V7 - I
Chromatic functionality. In the 19th-century, composers began to rebel against the traditional V-I paradigm and started taking the predominant directly to the tonic (plagal cadence) therefore bypassing the dominant-tonic cliche. Its function is cadential, a sort of dominant-substitute although I wouldn’t call it a dominant.
any minor key: ii half-dim 6/5 - i
A common 20th-century variation of this plagal cadence uses modal mixture (borrowing chords from parallel major or minor). The “Hollywood Cadence,” as it is known in some theory texts, (see Steve Laitz, “The Complete Musician,” “modal mixture”) occurs in the major mode, borrowing the ii half-dim 6/5 from the parallel minor.
Try this at home. Here's a great trick! Try using this harmony in a MAJOR key, substituting a diatonic ii7 chord (supertonic) with the ii half-dim 7. This process is called modal mixture, which is borrowing harmonies from the parallel mode, a form of chromaticism. It's a common technique traced back to Bach with the Picardy 3rd (a MAJOR tonic at the end of a MINOR-mode piece), but used ubiquitously throughout the 19-century.
any major key: IV - ii half-dim 6/5 - I
Holiday harmony. Lastly, the half-dim 7th harmony is also the notorious chord that evidently makes Christmas music sound, er, "Christmassy," as described by Maddy Shaw Roberts.