The law is very clear and straightforward for this. In CA, you have two options to properly serve this type of notice (a "notice of entry"): you can serve it personally to them or or mail it. Do not call or text. Do everything correctly and you will save yourself from legal/financial headaches in the future.
Serving/posting is best if the contractor is scheduled to go over there in the next few days, because you only need a reasonable amount of time of notice, and the actual code says 24 hour notice is presumed to be reasonable. You try to give it to them personally, or an adult at the property, and if nobody is there you can post it on the door. I recommend doing this more than 24 hours in advance, maybe a couple days before if you can. Keep copies of everything you serve/post for your own records too.
You can also mail it, but there needs to be 6 days notice (6 days from the day of mailing that is). So if your contractor isn't scheduled to go for another week or two, mailing is a good option. Use a certified mail or something including a receipt as proof that you mailed it, and of course keep copies of everything you mail for your own records.
See CA Civil Code Section 1954 for specific details.