Job question

Just got hired for a new job, when do I tell them I’m pregnant? How do I go about it and when is the best time to let the job and Co workers know?