In CA, in general, when you get foreclosed on, IF you still have your original “purchase money loan” it is NON recourse debt, which means the debt is secured by the property and nothing more.
You will not get a 1099-C nor a deficiency judgment, nor owe any income tax for debt relief.
Your credit score will suffer. It will rise over time and it will stay on your credit report for 7 years.
IF your loan is a REFI loan, you will have issues to deal with. That is RECOURSE debt. See IRS guidelines for details.