Sometimes Sims can get stuck in a place they can't get out of, an object might be stuck to your Sim or they may simply stop moving and will not respond no matter what you do.
This makes Sims unhappy.
There's a way to fix that.
First open the cheat window by holding down
Ctrl + Shift + C; all three keys at once. This will pause the game and make the screen a little darker.
Now type the cheat
resetSim Firstname Lastname and press enter.
You should of course use the name of the Sim that needs help. Make sure everything is spelled correctly and exactly as shown (it may be case sensitive) and remember the spaces; you won't get an error message if it's not right, it just won't work.
For example if Gobias Koffi is stuck, type: resetSim Gobias Koffi.
This will return the Sim to a "safe and neutral state" which means they will appear somewhere on their home lot with all their needs in the green. This works for
all Sims, not just the ones you're controlling.
It may sometimes cancel their wishes or moodlets but it's still better than having a guitar glued to your head.
If you need to reset
all Sims in your current game the code is:
resetSim *