Ayesha reported,

The day of Ashura was a day that the Quraysh used to fast in the pre-Islamic era, and the Prophet ﷺ used to fast it. When he arrived in Medina, he fasted it and ordered others to fast it. Then when Ramadan was prescribed, whoever wished fasted it, and whoever wished did not fast it.

Bukhari 3831

Sahih

حدثنا مسدد حدثنا يحيى حدثنا هشام قال حدثني أبي

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

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

البخاري 3831صحيح
Contents
Reference
Commentary
Ayat
Collection
Sahih Bukhari
Book
Virtues of the Ansar
Chapter
Days of Jahiliyyah
Numbering
Darussalam 3831
Bukhari 3831