Retirement tax questions

Got it. Since I may not be eligible to contribute to Roth anytime soon (even if I file as MFS), I might as well withdraw the 2022 contribution. From what I read, I have to withdraw the contribution and gains , pay early withdrawal penalty of 10% and pay taxes on the gains. Am I correct ?