In general, direct contributions are taken out first, followed by conversions, followed by earnings. (For the exact rules, including more details on withdrawal ordering of conversions I'd recommend researching Roth IRA withdrawal ordering. Note that the rules for accounts like Roth 401k are different.)
Direct contributions are not subject to tax or penalty when withdrawn, so if one can always withdraw their total direct contributions without tax or penalty from a Roth IRA, while leaving earnings in the account. Withdrawing taxable portions of conversions or earnings may result in tax and/or a 10% penalty, depending on ones circumstances.