My two-year-old son often wakes up in the night to discover that he's rolled away from us. Not liking that, he'll start to cry. If he gets himself too worked up, it can be a pain to put him back to sleep. But there's a little trick that we've discovered that works like magic.
If you say a word he knows, he repeats it. If you keep saying words he knows, he'll keep repeating you. He'll do this until he falls back asleep—often mid-word.
He's very accustomed to repeating after us. Because he's learning Chinese, English, and Japanese, we often have him repeat something he says in one language to a person with whom he should be speaking another language (Japanese with my wife, English with me, and Chinese with caregivers).
So if I'm the one whose trying to get him back to sleep, I'll say something like "Albert, 'dog'." If he's not feeling too annoyed, he'll simply repeat the word. If, on the other hand, he's feeling annoyed, he'll try to negate whatever word you say—but still while repeating the word.
Earlier tonight, he did the latter. I said a word, such as "nose", and he replied with a trilingual pidgin of "noseない爸爸". ない nai is Japanese for "there is no" and 爸爸 bāba is Chinese for "dad". So literally what he was saying was "There's no nose, dad". However, what he really meant was "I don't give a crap about 'nose', dad!" (I know this because even when I use his own body parts as vocab sources—nose, hair, ear, etc.—he says they don't exist.) Each time after he said that, I said, e.g., "Say 'No nose, daddy'" and he'd say "No nose, daddy" just the same. (As an aside, he knows what we want him to do when we say "Say x", although he's never said "Say x" himself.)
The one thing you can't do is say words that will trigger him to do something other than sleep. Words like "eat" and "drink" will lead him to want to, unsurprisingly, eat and drink. Likewise, if he wants his mother and she's not there, words like "mama" are not going to be productive. But pretty much anything else goes.