The Messenger of Allah ﷺ said, "Do not precede Ramadan by fasting a day or two before it, except for someone who has a regular fast he observes, in which case he may fast it."
حدثنا هشام بن عمار حدثنا عبد الحميد بن حبيب والوليد بن مسلم عن الأوزاعي عن يحيى بن أبي كثير عن أبي سلمة
قال رسول الله ﷺ لا تقدموا صيام رمضان بيوم ولا بيومين إلا رجل كان يصوم صوما فيصومه
Bukhari narrated it in the Book of Fasting, chapter "No One Should Precede Ramadan by Fasting a Day or Two," hadith no. 1914, and Muslim in the Book of Fasting, chapter "Do Not Precede Ramadan by Fasting a Day or Two," hadith no. 1082, from the hadith of Yahya, through him, with similar wording.