You do not have to be involved in the lawsuit if you do not want to. And, this case will not affect your credit. However, if the landlord wins, the Sheriff will evict all persons residing in the rental unit whether or not their name was on the summons and complaint.
If you want to join the lawsuit, you have the right to do so. Fill out the Prejudgment Claim of Right to Possession (CP10.5), that was attached to the court papers you received. Then file it at the courthouse within 10 days. You must also file an Answer - Unlawful Detainer (UD-105) within 5 days of filing the Prejudgment Claim of Right to Possession form.