They used to fast on the day of Ashura before fasting in Ramadan was made obligatory, and it was the day on which the Kaabah was draped with its covering. When Allah made the fast of Ramadan obligatory, the Messenger of Allah ﷺ said, "Whoever wishes to fast on it may fast, and whoever wishes to leave it may leave it."
حدثنا روح قال حدثنا محمد بن أبي حفصة قال حدثنا ابن شهاب عن عروة
كانوا يصومون يوم عاشوراء قبل أن يفرض رمضان وكان يوم فيه تستر الكعبة فلما فرض الله عز وجل رمضان قال رسول الله ﷺ من شاء أن يصومه فليصمه ومن شاء أن يتركه فليتركه