Command to stop player being an OP on minecraft?

I know on minecraft you can make a player an OP by using the command /op PLAYERNAME but what command do you use to undo this?

/deop PLAYERNAME

You should only do this if you have permission to do so from the server owner, or you are the server owner.

You can also edit the ops.txt file in the server directory and remove their player name.