The day of Ashura was a day that Quraysh used to fast in the pre-Islamic era, and the Messenger of Allah ﷺ used to fast it as well. When he migrated to Medina, he fasted it and ordered others to fast it. When the obligation of fasting the month of Ramadan was revealed, Ramadan became the month he fasted, and he left fasting the day of Ashura optional. Whoever wished could fast it, and whoever wished could break his fast on it.
حدثنا عباد بن عباد عن هشام بن عروة عن أبيه
كان يوم عاشوراء يوما يصومه قريش في الجاهلية وكان رسول الله ﷺ يصومه فلما قدم المدينة صامه وأمر بصيامه فلما نزلت فريضة شهر رمضان كان رمضان هو الذي يصومه وترك يوم عاشوراء فمن شاء صامه ومن شاء أفطره