The advice in this thread is accurate. The "conversation" would go something like this:
You: “Hey IRS, I’m going to withdraw $3,000 from this Roth IRA account.”
IRS: “Okay. How much have you contributed to it over the years?”
You: “$60,000.”
IRS: “Alright, you can take that without penalty. For future reference, you can now only withdraw $57,000 without penalty. Have a nice day.”
Also, don't forget that unlike a 401(k), whatever you take out can never be put back. The only exception is if you rollover from one broker to another, then you have 60 days before penalties are calculated and assessed.