No, you do not delete transactions in accounting.
Assets are listed on the balance sheet, it is impossible to trade in a car asset and not affect the balance sheet, as well as adding two new cars to the balance sheet.
Create in the chart of accounts some new accounts.
Fixed assets, one for each new car and one accumulated depreciation account for each new car. I generally do it this way
fixed assets
>> car, 2022 toyota
>> >> cost
>> >> accumulated depreciation
>> car, 2019 ford p/u
etc etc
Liability account for the new loan,, if there are two loans then two liability accounts
Calculate and post partial year depreciation for the old car. If you do not have any then you need to see a tax accountant. Accumulated depreciation expense is optional, you do not have to take it. But you must take it when the car is sold or disposed of, the tax accounting entries for this is a mystery for me since I always take the depreciation expense.
journal entries
debit old car accumulated depreciation, and credit old car fixed asset for the balance in the accumulated depreciation account
credit old car fixed asset account and debit new car fixed asset for the balance in the old car fixed asset account
Debit the old loan account and credit the new loan account for the balance in the old loan account. Be sure to use the correct loan account since only one of the two new cars paid off the old loan
debit the car fixed asset and credit the loan liability account for each cars loan amount. Note that the car that paid off the old loan has to have its total loan amount reduced by the amount of the old loan.
Enter any down payments you made, if any, and use the correct car fixed asset account as the expense (reason) for the payment