You can still file a lawsuit or collect a judgment even if the defendant has died. You will direct your efforts at the deceased person's estate–that is, the property the person left behind. And you must act promptly; if you don't, your claim may be barred by law.
Unless the defendant arranged for everything in the estate to pass outside of probate (by using a living trust or other probate-avoidance device), there will probably be a probate court proceeding. It's conducted by the estate's "personal representative"–the executor named in the deceased person's will or, if there is no will, an administrator appointed by the court. Usually, the surviving spouse or an adult child is the personal representative.
A personal representative who knows that you were owed money is required to send you, within four months after beginning to act on behalf of the estate, a notification of the death. The notice will advise you to make a claim by a certain deadline, set by law. You will probably have at least one or two months in which to file your claim.
If you don't get a notice of the death, you can still submit a claim. Find out whether or not there's a probate proceeding (and if so, who the personal representative is) by checking probate court records in the county where the defendant lived at the time of death. If you miss the deadline, a late claim may be allowed up to one year from the date of death.
You make your claim by submitting a regular bill or by using a court document called a Creditor's Claim (Form DE-172, available at www.courtinfo.ca.gov). Submit your claim directly to the probate court and serve a copy on the personal representative. If you file a formal claim and the personal representative rejects it, you can file suit against the estate within three months of the rejection.
What if there's no probate proceeding? In that case, your best bet is to present your claim to the deceased person's spouse, child, or close relative. If it is denied or ignored, you have the right to file suit against anyone who inherits from the deceased. Do it as soon as possible.