How to tax trade-in value of mixed use vehicle

I used my car for personal and freelance work travel. It finally died on me, and I traded it in for $500 off a new 2022 vehicle. Only 17,379 miles of the 180,000 total miles were for work (9.655%).

I've been calculating deductions yearly using mileage, not expenses or asset deprecating. Do I need to pay taxes on the trade-in value, and  if so, how do I figure it out? Not sure how to enter this in TurboTax because it's not seeming to ask the right questions.

Also, can I deduct the $80 towing fee from when I had it towed to the mechanic, and the mechanic's fee to asses the situation as a sales expense? The dealer picked it up from the mechanic for free after the sale.