Ashura was a day we used to fast during the days of ignorance. When Ramadan was made obligatory, the Messenger of Allah ﷺ said, "This is one of the days of Allah, so whoever wishes may fast it, and whoever wishes may leave it."
حدثنا مسدد حدثنا يحيى عن عبيد الله قال أخبرني نافع
كان عاشوراء يوما نصومه في الجاهلية فلما نزل رمضان قال رسول الله ﷺ هذا يوم من أيام الله فمن شاء صامه ومن شاء تركه
Bukhari reported it in the tafsir of Surah Baqarah, chapter, "O you who believe, fasting has been prescribed for you..." etc., no. 4501, from Musaddad, and Muslim, no. 1126, see the preceding hadith, from the hadith of Yahya Qattan, through him.