Ayesha reported,

The day of Ashura was a day that Quraysh used to fast during the pre-Islamic era, and the Messenger of Allah ﷺ used to fast it as well. When he arrived in Medina, he fasted it and ordered others to fast it. Then, when Ramadan was made obligatory, the fast of Ashura was left as optional. Whoever wished to fast it could do so, and whoever wished to leave it could do so.

Bukhari 2002

Sahih

حدثنا عبد الله بن مسلمة عن مالك عن هشام بن عروة عن أبيه أن

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

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

البخاري 2002صحيح
Contents
Reference
Commentary
Ayat
Collection
Sahih Bukhari
Book
Fasting
Chapter
Fasting on the day of Ashura
Numbering
Darussalam 2002
Bukhari 2002