You definitely don't want to just pull the plug. This can cause problems with the SD card and file system. 

From the command line or a terminal window you can enter the following to do a clean shutdown:

    sudo shutdown -h now

Or from the LXDE GUI:

Click the shutdown button (red power button) in the menu bar at the bottom right corner of the screen. Then click shutdown.

Once it says "system halted" you can remove the power cord if needed.