I recently posted a question and soon after realized I shouldn't've posted it yet. It very quickly got a downvote and from what I know you shouldn't delete a downvoted question and repost it. What should I do in the future if I ever do this again?
You're missing an option!
You can delete the question, draft an update to it (in a word processing program, for example), and then undelete it and edit it to reflect what you want. As long as the question doesn't have an upvoted answer, you can delete it.
It's even in the help center:
Self-deleted questions can be viewed and undeleted by their original authors. If you delete your own question, you must undelete it before you will be able to edit it.
You don't have to repost it, you just click "undelete" and it goes back to being live on the site, at which point you can edit it quickly. We actually very much encourage this! We love it when people posting questions improve the question. Heck, you don't even need to delete it unless you don't think you can edit it quickly enough to get it in shape before it attracts more downvotes.
For an explanation of the reasoning behind this, see Oded's answer here. (Hint - spam makes it so that we can't have nice things)