Earthquakes are rough. They come from out of nowhere and can be extremely serious very quickly. Earthquakes often lead to other circumstances: fires quickly spring up from broken gas lines and downed power lines. People can get trapped in rubble. And they almost never happen once, aftershocks can be even more damaging than the original quake.Since evacuation typically isn't possible during an earthquake, people have to make due finding shelter where they are at the time. Ready.gov has a list of guidelines for what to do during a quake here.
Preparing your home
There are ways to be warned before a quake is about to hit. There are 2 types of waves a quake emits, P waves and S waves. Think of P waves like the flash of lightning and the S waves as the thunder. P waves travel much faster than the destructive S waves that follow them and can be detected by devices like Earthquake Alarms.
If you live in Southern California there is the ALERT Radio System which operates on a few Amateur frequencies that also provides an advanced warning to those with VHF/UHF radios like an inexpensive Baofeng. Any upcoming earthquakes that are level 3.0 or higher will come through the radio's speaker.The USGS is also working on an advanced warning system like one in Japan, which will send text messages to all phones in the area. It hasn't been fully implemented yet at the time of writing however due to technical and funding issues.
Minimizing the Damage
If you live in an earthquake area, it is possible to reduce the damage that they can do in your home. One of the biggest problems is items falling off of shelves or walls an out of cupboards. You can hold down items by using Museum Wax (aka Quake Putty) to stick them to the shelf.
To keep cabinets closed during an earthquake consider using SeismoLatches in addition to locking shelf pins (so the shelves don't collapse inside the cabinet.) Furniture and TV's should be strapped to the walls. This is a good idea even if you don't live in a quake area, but have kids around who could get hurt by climbing on things they shouldn't.
Tremor Hangers can keep paintings and photographs from falling off the walls.
Broken gas and water lines coming into your home can also cause big problems. These may have to be turned off after a quake; you might need a special tool to do so.
PREPARING YOUR Bug Out Bag
Having a hard hat on hand isn't a bad idea either. If you need to work in rubble doing search and rescue than these are must have items.Fresh water will be an immediate need as well, so keep some bottles on hand, things will be dusty. Fires can spring up so have a few fire extinguishers around.
And if you get trapped, having a whistle night save your life.
Earthquake Country Alliance has a fantastic website with lots of very detailed information about preparing yourself, your family, and your home from earthquakes.