In the episode, Big Bird (I think) would say goodnight to each of his body parts...so "Goodnight toes, goodnight foot, goodnight leg, goodnight knees" and so on.
I think what ends up happening as you say goodnight to each body part, you subconsciously "relax" them, so to speak. And by the time you get to your upper torso...you're pretty much drowsy enough to nod off.