Your IRS custodian sends a Form 5498 to you and to the IRS each year in which you make contributions. The total of all those (minus any withdrawals, but you don't have any withdrawals yet) represents the contributions which you can withdraw without tax or penalty before 59.5. (The rules can be more complex than this; see Instructions for Form 8606 Line 22.)
If you pull all the contributions, then you could pull conversions next, but it sounds like you don't have any. (Conversions should be reported on Form 8606 Part II.)
Earnings come out last.
If you withdraw funds prior to 59.5, then the IRS expects you to complete Part III of Form 8606.
Theoretically, between Form 5498s from your IRA custodians and Form 8606s you've filed, I think the IRS has all of the information needed to track and calculate if you've done things right. I have no idea if they enforce this stuff. I suspect it is a low enforcement priority because, in the big scheme of things, it's not that many people, and not that much money. They might check it if they did a full audit, or they might have implemented some basic sanity checks.