Writing a song might as well be impossible. Stephen Sondheim knew this perhaps better than anyone.

“A song exists in time,” explained the musical theater composer and lyricist, who died Nov. 26. It is not like a poem you can stop and start and read at any pace you like and return to if you fail to grasp its meaning the first time. A song is delivered in time, and it has only as long as it lasts to tell you what it is trying to say, whether you hear it or not.

It can’t be too clever, and it can’t be too dull. It has to land on your ear as a surprise. If it contains jokes, they have to rhyme. (If it contains rhymes, words that are spelled differently are funnier, Sondheim thought, than words that are spelled the same.) And it doesn’t hurt if it’s hummable.

The song has to take the character singing it somewhere. It has to be essential to the show. “If you can take the song out," Sondheim said, "and it doesn’t leave a hole, then the song’s not necessary.” If this all sounds impossible, I can assure you (as someone who has been trying with variable success to write musical theater as long as I’ve known what it was and will keep trying until they take all the pens away), it’s even harder.

Sondheim made it look possible. Not just possible; easy. He created indelible songs and lyrics that both function perfectly in the shows they call home — a breathtaking panoply from his first lyric-writing hit, “West Side Story,” to “Gypsy" to “Company” to “Into the Woods” to “Assassins” to “Sweeney Todd” — and work outside them. He married form and content so effortlessly that the songs feel found rather than made, like the only possible way of expressing the thoughts they contain. Love is overwhelming and silly and as simple as “Maria! Maria! Maria! Maria!”

Of course, theater, especially musical theater, is an art form that’s highly artificial. People do not, it is often snidely observed, burst out into song in the middle of actual life. But this artifice is in service of a higher truth: The way we actually experience life is muddled and ambivalent and full of stops and starts and revelations that come too soon or too late. Sometimes words come to you before the meaning behind them fills in. (Sometimes, for instance, your high school puts on “Company”; you may be working very hard to be disillusioned, but you are 17.)

A lot of musical theater, especially Sondheim’s, takes advantage of the artificiality of the form to occupy the spaces we move through too quickly. Many of Sondheim’s most poignant songs show people standing apart from life to contemplate it: Cinderella dithering on the steps of the palace, or a bride-to-be wavering on the verge of commitment. The songs that make the most exciting case for life are sung by people who aren’t quite living it.

People, Sondheim included, are always trying to set up this dichotomy between art and life. Yeats railed, “The intellect of man is forced to choose perfection of the life or of the work.” In his own work “Sunday in the Park With George,” Sondheim set up attention to craft as something in contrast to and separated from life itself. The pointillist painter Georges Seurat sings:

They have never understood,
And no reason that they should,
But if anybody could, finishing the hat.
How you have to finish the hat.
How you watch the rest of the world
From a window while you finish the hat.

But surely Sondheim knew better than anyone that life and art are not separate; we need art to give life back to us, to give us words for the water we’re moving through. Words for the in-between places, when you’re stuck in a moment of indecision or hesitation or just wishing it were possible to have “your mother at the door, the roof, the house and the world you never thought to explore.”

Coming up with the right words, words that can be heard, words that are essential — this isn’t something different from life. This is the thing that makes life worth it. Sondheim must have known that he wasn’t watching the rest of the world from a window; he was opening a window for the rest of us.

Life also exists in time. You cannot stop it and start it and go back and hope to make yourself better understood. You must express yourself in the moments allotted and make yourself heard and choose what to say.

If you are lucky, and a genius, it will also be hummable.

Fans standing outside of the Broadway theater named after Stephen Sondheim celebrated his contribution to American musical theater on Nov. 26. (Reuters)