Quraysh used to fast the day of Ashura in the era before Islam, and then the Messenger of Allah ﷺ ordered that it be fasted until the fast of Ramadan was made obligatory. The Messenger of Allah ﷺ said, "Whoever wishes may fast it, and whoever wishes may break his fast."
حدثنا قتيبة بن سعيد حدثنا الليث عن يزيد بن أبي حبيب أن عراك بن مالك حدثه أن عروة أخبره
أن قريشا كانت تصوم يوم عاشوراء في الجاهلية ثم أمر رسول الله ﷺ بصيامه حتى فرض رمضان وقال رسول الله ﷺ من شاء فليصمه ومن شاء أفطر