Can I still do a backdoor Roth if I've invested the $ in the trial ira?

In 2022, I opened a Traditional IRA and contributed 1000 post-tax dollars. I invested that 1000. I’m looking to do a backdoor Roth. Can I sell my investment, contribute the rest of the 5000 and still convert all to Roth IRA for 2022? In addition, can I contribute extra 6500 for 2023 and convert all? Mainly, my question is about that invested 1000 (now ~$904) and what to do with it.

If you contributed after-tax dollars to a traditional IRA a while ago, you can do a Backdoor Roth IRA. Normally, the downside would be that you would owe tax on any gains at the time of the transfer, but in your case since it sounds like you have a loss inside the IRA, it won’t be a taxable event.

Crossing calendar years while trying to complete a Backdoor Roth IRA can make things complicated. So, contributing $5000 in 2023 for 2022 and then doing the conversion for 2022 can be done. But will require some nuances when filling out the tax forms (I would consult with a tax planner prior to doing this).