You may have other charge on your ticket
Tail light failure in most state is correctable violation. In CA, If that is the only charge, you can fix the light and have a local officer or highway patrol to inspect it the sign off the ticket. You should be able to mail the ticket back to the court with $25 administration fee. If in other state, you may need to see the judge in person but the judge most likely will dismiss the case if you prove the light has been fixed and just pay the admin fee.
If your facing $402 charge, I think you have other charge on your ticket such as driving without valid DL, or expired driving permit, or driving without insurance. Only such violations could set such high penalty. I think the first step is double check your ticket and find out what exactly the cop wrote the violation code on your ticket.