gain or loss basis

This is first time this question for Gain or Loss has come up.. Plus other questions after that on this  like Gain on Sale, Prior depreciation etc.  dont know how to do this. have only been doing this independent work since 2022.

I am independent contractor. I use my vehicle for work and personal.  I traded in my suv i used all year on a newer model on 11-30-23.  The vehicle was not paid off .  They allowed X amt of dollars trade in value towards the purchase of the new suv and the excess of the loan was added to the new loan .