In California it's very difficult for a seller to keep a buyer's earnest money deposit. You'd have to prove you've suffered some damages to lay claim to their deposit.
If the buyer canceled under contingencies stated in the contract, there's not much you can do except return their deposit and put the home back on the market. If all the buyer contingencies were removed you may have a right to keep all or part of the deposit. You'd need to retain an attorney to advise you on where you stand.
Have your listing agent go over the contract with you and determine whether the buyer had lived up to the terms of the contract, and were they proceeding in good faith?
Best of luck to you!