here is how it works:
the first money withdrawn from the Roth is your contributed dollars - those were all after-tax contributions to begin with, so no tax implications - no income tax and no penalty.
Once all that is liquidated, the 2nd bucket of money withdrawn are any dollars converted from a TRAD IRA. The dollars that were converted at least 5 years ago are not subject to any tax - no income tax and no penalty. Any dollars converted in the last 5 years are subject to a 10% penalty (but no income tax).
once that is all liquidated, the last bucket of money withdrawn is the increased value of the Roth. Since you are under 59.5 years old, this bucket is subject to income tax and the 10% penalty for early withdrawal.
You will avoid the 10% penalty where applicable for education expenses, but not any income tax.