Nope NEVER just yank the cord. That will definitely corrupt all your cards. The code is sudo shutdown -h now it also runs that code if you choose shutdown from the emulation station menu.i also just use this app on my phone cause im too lazy to type it in the terminal.
Good thing you had the common sense to ask since some people never realise that what they are doing is ruining their stuff so that every time their card corrupts they blame the retropie project when in reality it’s user error.
I think it would be nice if the raspberry pi came with an on off button but there are ways you can modify the hardware to add one like the control block, mausberry switch, etc.
Unplug it after you’ve run the sudo shutdown -h now and then plug it back it to turn it back on. At least until you’ve added hardware with an on button. I typically just leave my pi on because I’m too lazy to keep turning it off and on.