It is very possible, and likely, that you will get to keep your vehicle if you file bankruptcy, if you want to keep it.
If you owe on the vehicle, and you are current on your payments, then you can generally continue to keep paying who you owe and keep the vehicle in whatever type of bankruptcy you file.
If you are behind on the payments on the vehicle, and you want to keep it, there is a type of bankruptcy (Chapter 13) where you can pay for the vehicle through the bankruptcy and eliminate the payment, and sometimes lower the interest rate on the debt. You can still do this even if you are current, possibly in order to lower the interest rate.
Likewise, if you owe on a vehicle and want to stop paying and don’t want to keep the vehicle, you can surrender it and in some types of bankruptcy owe nothing, and in another type, surrender and pay what’s left owing through the bankruptcy (Chapter 13) after the vehicle is sold.
It is important that you discuss your options with an experienced bankruptcy lawyer as soon as possible. Most lawyers are willing to offer you a free, no obligation appointment to discuss your situation to see if bankruptcy is right for you and how it would effect your vehicle.