I have heard that if you withdraw money from your Roth early, there is no penalty or tax as long as it is a "contribution". However "earnings" cannot be withdrawn early without paying tax and 10% penalty. When I put money into my Roth how will it be classified as earnings or a contribution?
Deposits are contributions. You deposit say, $5000, and over time you have $6000. The $5000 can be withdrawn any time with no issue. It's tracked via form 8606.
With this in mind, I wrote an article The Roth Emergency Fund, suggesting that since one can withdraw deposits with no issue, the Roth can be used to hold emergency money.