Baby’s birth certificate

First time moms, how did you get your baby’s birth certificate and how soon a free he/she was born did you get it? I live in California btw.