Ayesha reported,

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."

Bukhari 1893

Sahih

حدثنا قتيبة بن سعيد حدثنا الليث عن يزيد بن أبي حبيب أن عراك بن مالك حدثه أن عروة أخبره

عن عائشة رضي الله عنها

أن قريشا كانت تصوم يوم عاشوراء في الجاهلية ثم أمر رسول الله ﷺ بصيامه حتى فرض رمضان وقال رسول الله ﷺ من شاء فليصمه ومن شاء أفطر

البخاري 1893صحيح
Contents
Reference
Commentary
Ayat
Collection
Sahih Bukhari
Book
Fasting
Chapter
Obligation of fasting Ramadan
Numbering
Darussalam 1893
Bukhari 1893