Ibn 'Umar (Allah be pleased with both of them) reported Allah's Messenger (ﷺ) as saying
The month may consist of twenty-nine nights. So do not fast till you have sighted it (the new moon) and do not break it till you have sighted it, except when the sky is cloudy for you, and if it is so, then calculate it.