An emergency fund is a vital part of any financial plan, and can be a real lifesaver when disaster strikes. Here's how to build one and when you should use it.