The Prophet ﷺ said, "None of you should precede Ramadan by fasting a day or two beforehand, unless it is a man who regularly observes a fast that happens to fall on that day, in which case let him fast it."
عن النبي ﷺ قال: لا يتقدمن أحدكم رمضان بصوم يوم أو يومين، إلا أن يكون رجل كان يصوم صومه فليصم ذلك اليوم.
Bukhari narrated it in the Book of Fasting (1914), and Muslim narrated it in the Book of Fasting (1082), both through Hisham (he is Ibn Abu Abdullah Dastawai), who said, we were told by Yahya bin Abu Kathir, from Abu Salama (he is Ibn Abdul-Rahman bin Awf), from Abu Hurairah, and he related it. The wording given is Bukhari's, and Muslim's wording is close to it. Abdul-Razzaq also narrated it (7315), and through his route Ahmad narrated it (7779), from Mamar, from Yahya bin Abu Kathir with his chain, with the wording, "The Messenger of Allah ﷺ forbade anticipating the month of Ramadan by fasting a day or two before it, except a man who was already keeping a regular fast and it happened to fall on his usual fasting day." Its chain is sahih.Hafiz said in Fath al-Bari (4/128), "The scholars said, the meaning of the hadith is, do not welcome Ramadan by fasting with the intention of precaution for Ramadan. Tirmidhi said, when he narrated it (684), the practice among the people of knowledge is upon this, they disliked that a man should anticipate Ramadan by fasting before it begins for the sake of Ramadan."