You are the guarantor of the existing loan. So when the loan is past due, it will be your legal liability. Even worse - even you pay off the loan, you don't own the car, but your friend does still.
In a simple word - you have no relationship with the car at all.
The only way is to negotiate with the company originating the loan and let the company know your intention. Since the car is still a collateral of the loan, the company has the legal right to repossess the car for non-payment. And then you can purchase from the company and absorb the remaining balance of the loan.