Ayesha reported,

Aishah reported that the day of Ashura was a day the Quraysh used to fast during the days of ignorance, and the Messenger of Allah ﷺ used to fast it then as well. When the Messenger of Allah ﷺ arrived in Medina, he fasted it and commanded others to fast it. Then, when fasting Ramadan was made obligatory, that became the obligation, and the day of Ashura was left optional. Whoever wished, fasted it, and whoever wished, left it.

Azami 4480

Sahih

عن عائشة أنها قالت

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

الأعظمي 4480صحيح
Contents
Reference
Commentary
Ayat
Collection
Jami al-Kamil
Book
Fasting
Chapter
Voluntary fasting and encouragement to do it
Section
Clarification on the abrogation of the obligation to fast on Ashura after the obligation of fasting in the month of Ramadan
Numbering
Jami al-Kamil 4480 (2nd edition)
Azami 4480