قَوْلُهُ تَعَالَى: {كُتِبَ عَلَيْكُمُ الصِّيَامُ كَمَا كُتِبَ عَلَى الَّذِينَ مِنْ قَبْلِكُمْ} [البقرة: 183]
The Quraish used to fast on the day of 'Ashurah in pre Islamic days. The Messenger of Allah ﷺ would fast on it in pre-Islamic period. When the Messenger of Allah ﷺ came to Medina, he fasted on it and commanded to fast on it. When the fast of Ramadan was prescribed, that became obligatory, and (fasting on) 'Ashurah was abandoned. He who wishes may fast on it and he who wishes may leave it. (Using translation from Abū Dāʾūd 2442)
«كَانَ يَوْمُ عَاشُورَاءَ يَوْمًا تَصُومُهُ قُرَيْشٌ فِي الْجَاهِلِيَّةِ وَكَانَ رَسُولُ اللهِ ﷺ يَصُومُهُ فَلَمَّا قَدِمَ الْمَدِينَةَ صَامَهُ وَأَمَرَ بِصِيَامِهِ فَنَزَلَ صَوْمُ رَمَضَانَ فَكَانَ رَمَضَانُ هُوَ الْفَرِيضَةُ فَمَنْ شَاءَ صَامَ يَوْمَ عَاشُورَاءَ وَمَنْ شَاءَ تَرَكَ»