In order to protect your car from repossession, you should file a motion with the bankruptcy court as soon as possible after filing the bankruptcy petition. The motion should request a stay of the repossession. If the court grants the stay, then the creditor will be prohibited from repossessing the car.
It is important to note that a bankruptcy discharge does not eliminate the debt for the car. If you want to keep the car, you will need to make the payments on the loan after you file for bankruptcy. If you do not make the payments, the creditor can repossess the car even after the bankruptcy discharge.