It's a short story in an anthology but I haven't been able to find it by looking through various Best SF of 19XX (it was probably from the 60s-80s, though I read it in the early 2000s) story lists. I remember that the humans in this story are enslaved by aliens to the point of effectively being treated like horses, and have been for long enough to have forgotten. The male protagonist and possibly a female he meets find an escape spaceship and figure out how to use it via an instructive rhyme they know - they have to activate it and put themselves into stasis using a hypodermic needle. The rhyme ends with something along the lines of "go to sleep and all will be well.
"The Silk and the Song", a novelette by Charles L. Fontenay; first published in The Magazine of Fantasy and Science Fiction, July 1956, available at the Internet Archive; also the answer to this old question. Here are some covers under which it has appeared; see anything familiar? Your description of the story is very good. Here is the rhyme you remember:
Twinkle, twinkle, golden star,
I can reach you, though you're far.
Shut my mouth and find my head,
Find a worm that's striped with red,
Feed it to the turtle shell,
Then go to sleep, for all is well.