A credit card account is a liability type by nature. Therefore, the CREDIT side will increase its balance, and the DEBIT side will reduce its balance. This is why your expenses are posted on the CREDIT side because you increase your credit balance as you use your card.
If you're recording a bank transaction in QuickBooks Online manually, you'll need to make sure that the categorization is correct. This way, the transaction journal of your entries will be accurate.
In case the category of the transactions is incorrect, you may delete them. Then refer to this link on how to record credit card payments afterward: Record your credit card payments.
However, if these transactions are downloaded from your bank account, you may exclude, then re-download these transactions. This way, we can post it to the correct accounts.
To do that:
Click Banking, then go to the Banking tab.
Go to the Review tab.
Select the transactions you'll want to undo, then click Undo.
After that, let's exclude them:
Go to the For Review tab.
Select the transactions you'll want to exclude.
Click Batch actions, then select Exclude Selected.
Next, manually update the bank account to download the entries again. Just click the Update button on the Banking page.