Hold the PS button to bring up your menu.
Go to Network or Friends (depending on your firmware)
Go to your desired friend and press triangle.
Now press send then press send new message.
Use your controller or usb keyboard and type the message.
Press send using the X button.
Press PS again to return to your game.
!! [EDIT] !!
The XMB is the Cross Media Bar aka the thing you move left, right, up, and down to select things in the menu it's the screen you get when your browsing your photos, etc.
If you need further help you may add me on PSN, my id is Kovu7362