Based on your description of the issue above, it seems that you've created a journal entry and interchange the accounts under the Debit column in QuickBooks Online (QBO). You can resolve this by editing the entries on the said transaction to correct its details and change the posting account.
You'll have to search the journal entry through the Advanced Search feature, then open it from there to view its details. Here's how:
Go to the Magnifying glass icon above beside the Help menu.
Select the Advanced Search option below.
In the Search page, select Journal Entries in the drop-down field.
Click the Add Filter button to display the Date Filter drop-down and customise the search.
Find and select the Journal Entry to open its contents.
On the Journal Entry page, make the necessary updates. Change the posting account under the Debit column.
Once done, I'd recommend pulling up a financial/accounting report (i.e. Journal). This is to effectively monitor the debit and credit accounts used in your journal entries. Just go to the Accounting reports section from the Report menu's Standard tab.
Additionally, I want to make sure I've got everything covered. In case you've created another kind of transaction and wanted to correct its posting accounts, you can share further details about it. This way I can provide its exact resolution.
Please know that you're welcome to comment below if you have other concerns or follow-up inquiries about managing business accounts and transactions in QBO. I'm just around to help. Take care always.