Filing an extension does not give you more time to pay your taxes. Although an extension gives you until October 16, 2023 to file your return, you'll still have to pay your taxes by April 18, 2023 (if you're out of the country, you also have until April 18, 2023 to pay your taxes).
Even if you can't pay your taxes by the deadline, go ahead and file an extension anyway. Doing so will protect you from the late-filing penalty, which can be up to 10 times higher than the penalty for not paying your taxes on time.