Castling is a very useful way to protect your king and confuse your opponent, and it is also the only time you are ever allowed to move two pieces at once. It works like this: when your king and a rook (it can be either one) both haven't been moved out of their home boxes for the entire game, you move your king two spaces towards the rook, and then move the rook to the opposite side of the king. Here's an example: Let's say that it's your move and your pieces are set up as below.

You're nervous that your king is so vulnerable and you want to protect it. So by castling, you are allowed to move your king two spaces right (toward your rook) and move the rook around to the king to the space next to it, as below:

Get it? The king moves two spaces towards the rook, and the rook goes right next to the king, but on the opposite side that it started on. And voil! You can also castle this way, from here

to here:

At the risk of sounding repetitive, you moved your king two spaces left, and moved the rook around to the box right next to it on the opposite side of where it started.

By the way, the proper way of castling is to move the king first, and then the rook.

SoYouWanna know more? Check out our full-length article SYW learn how to play chess?