You can request a "return of contribution" from the IRA custodian at any time up to the due date of the tax return (or extended due date, Oct 15, if a timely extension is filed). Any earnings on contribution must also be returned and the earning would be taxable.
If this was a 2018 contribution made in 2019 then the due date is April 15 and if an extension is filed prior to that (OR you timely file the 2018 tax return before Apr 15) then you have until Oct 15, 2019 to have it returned.
If it was a 2019 contribution then the dates to remove are April 15, and Oct 15, 2020 to have it returned.
Be sure to have it removed as a "return of contribution" and not just a normal distribution so the IRA custodian will properly prepare a 1099-R with either a code P (2018 contribution) or code 8 (2019 contribution) - the 2019 1099-R will be received next January.
Note: that if you remove it as a return of contribution, you will not be able to deduct it in 2018. If it was a 2018 contribution and you do want to deduct it then just remove it as a normal distribution that will be taxable income on your 2019 tax return. You can do that at any time.
Not much reason to do that since any 2018 tax savings in 2018 will be tax owed in 2019.
I think the intent of the question was more so related to this:
if you contribute on 4/1 and you are over 59 (but not yet 59 1/2) on that date, you need to wait until you are 59.5 to withdraw otherwise you are going to be hit with a 10% penalty.
Also, if you have not participated in the IRA for at least 2 years, the penalty to withdraw is 25%
@NCperson- There is no such thing as a "2 year rule" and 25% penalty for an IRA distribution. What are you referring to? Please cite your reference.