Solmization, or the practice of assigning syllables to the different “steps” of the scale, originated in ancient India. Fast forward a few thousand years, when Isidore, the Archbishop of Seville during the sixth century, lamented that "Unless sounds are remembered, they perish, for they cannot be written down." A Benedictine monk who was also a master of music named Guido d'Arezzo set to work to prevent so many sacred tunes from being lost.
Brother Guido was familiar with solmization, and noted that most of the Gregorian chants popular at that time could easily be learned by singers if they could see the tone progression up and down the scale, and associate it with the sound. He assigned the notes of the scale—C, D, E, F, G, A, B, C—a syllable: Do, Re, Mi, Fa, Sol, La, Ti, Do. (We know what you're thinking: Yes, it actually is SOL—it's traditionally written that way when the tonic notes are spelled out, and often referred to as the "sol-fa scale" colloquially—but that final L is hard to hear thanks to the LA that follows.)
Those weren’t just random sounds he chose; they came from “Ut Queant Laxis,” a well-known hymn of the Middle Ages that was chanted for vespers. Each succeeding line of the song started one note higher than the previous one, so Guido used the first letters of each word of each line: UT queant laxis, REsonare fibris: MIre gestorum , FAmuli tuorum: SOLve, etc. “Ut” was eventually deemed too difficult pronounce and was changed to “Do.”
Did the Guido method work? Well, as Rodgers and Hammerstein later put it, “When you know the notes to sing, you can sing most anything!”