From Sahih Muslim (Hadith 2641):
A'isha (Allah be pleased with her) reported that the Quraish used to fast on the day of Ashura during the pre-Islamic days. The Messenger of Allah (ﷺ) then commanded to fast on that day till (fasting) in Ramadan became obligatory. Then the Messenger of Allah (ﷺ) said:He who wishes to fast should do so, and he who wishes to break it may do so
Reference: Muslim 2641