If you are not a citizen or otherwise in the United States legally, then having a child does not guarantee that you will receive United States citizenship. When the child is of age, they can sponsor you, which may help you gain your citizenship. However, if you have been in California for more than six months without authorization, you may be deported and face a 10-year ban. You need to consider what will happen if the government deports you.
What happens to your child if officials deport you?
If you do not make prior arrangements, your child may end up in foster care, and your child could face mental and physical issues. You may also legally give your child to someone else to raise. They get to make all the decisions for your child, so if you come back to the United States later, it may be hard to gain control of your child. You should work with an experienced immigration lawyer, who may be able to get the judge to agree that the custody transfer is only for the length of time of your absence.
Applying for cancellation of removal
If you have lived a life of high moral standards and developed ties in the community, you may be able to apply for a cancellation of removal before you are deported. In order to qualify, you must have lived in the U.S. for at least 10 years. You will also need to prove that your deportation will cause undue stress to others.
If you are in this situation, speaking with a lawyer may be very beneficial. Your attorney can advise you on the best possible course to pursue in your circumstances.