Alan Harper's infamous library meltdown occurs in Season 4, Episode 16 of Two and a Half Men, titled "The Loogie and the Lie".
After being kicked out of a retirement home (where he'd been posing as an elderly resident), Alan seeks refuge at the local library. What follows is a masterclass in Charlie Sheen-era Two and a Half Men cringe comedy: Alan's increasingly erratic, disruptive behavior—loud phone calls, inappropriate conversations with patrons, a chaotic outburst over a "loogie" incident—culminates in his ejection from the premises.
The episode crystallizes Alan's tragicomic essence: a man desperately performing normalcy while his life collapses. The library—a space of enforced quiet—becomes a pressure cooker for his unraveling. Jon Cryer's physical comedy (the whispered shouting, the frantic justifications, the final slink-out) elevates what could be a one-note gag into a character study of shame.
Season 4 finds Alan post-divorce, financially ruined, bouncing between Charlie's house and increasingly humiliating living situations. The library arc is the nadir—and one of the series' most memorable set pieces.