The episode is "The Big, Bad Baby" (Season 5, Episode 7a).
Timmy accidentally wishes to become a baby again to avoid a difficult task. The wish backfires catastrophically—everyone in Dimmsdale turns into an infant, including his parents, Vicky, Crocker, and the fairies. Cosmo and Wanda (now babies themselves) can't reverse it. Timmy must navigate a world of helpless adults to find a way to restore order—leading to the classic "babies running a city" chaos.