It is not a necessary condition that they should be fasted consecutively. If you fast them separately or consecutively, it is OK. The sooner you do them, the better, because Allah says (which means):
He said, “They are close upon my tracks, and I hastened to You, my Lord, that You be pleased.” [Al-Quran, Surah Ta-Ha (20): 84]
And (you should hasten to fast these six days) because delaying may cause problems. This is the view of the Shafi’is and some of the Hanbalis, but it is OK if you do not hasten it and you delay it until the middle or end of the month of Shawaal.
Imam Al-Nawawi (may Allah have mercy on him) said:
Our companions said: “it is mustahab (highly encouraged) to fast six days of Shawaal. Because of this hadith they said: it is mustahab to fast these days consecutively at the beginning of Shawaal, but if one separates them or delays them until after Shawaal, this is permissible, because he will still be following the general guidelines of the hadith. We have no dispute regarding this matter, and this was also the view of Imam Ahmad.
Fasting six days of Shawaal after the obligatory fast in the month of Ramadaan is Sunnah Mustahab (highly encouraged), not wajib. It is recommended for the Muslim to fast six days of Shawal, and in this there is great virtue and an immense reward.
Whoever fasts these six days of Shawaal will have recorded for him a reward as if he had fasted a whole year, as was reported in a saheeh hadith from the Prophet (peace and blessings of Allah be upon him):
Abu Ayub (may Allah be pleased with him) reported that the Messenger of Allah (peace and blessings of Allah be upon him) said: “Whoever fasts Ramadhan and follows it with six days of Shawaal, it will be as if he fasted for a lifetime.” (Narrated by Imam Muslim, Imam Abu Daud, Imam al-Tirmidhi, Imam al-Nisa’i and Imam Ibn Maajah).
The Prophet (peace and blessings of Allaah be upon him) explained this when he said:
“Whoever fasts for six days after (Eid) al-Fitr has completed the year: (whoever does a good deed (hasanah) will have ten hasanah like it).” According to another report: “Allah has made for each hasanah ten like it, so a month is like fasting ten months, and fasting six days completes the year.” (Narrated by Imam al-Nisa’i and Imam Ibn Maajah).
It was also narrated by Ibn Khuzaymah with the wording:
“Fasting for the month of Ramadhan brings the reward of ten like it, and fasting for six days brings the reward of two months, and that is the fasting of the whole year.”
The Hanbali and Shafi’i Madhab fuqaha’ explained that fasting six days of Shawaal after fasting in the month of Ramadhan makes it as if one has fasted for an entire year of obligatory fasts, because the multiplication of the reward applies, because each hasanah brings the reward of ten like it.
Another of the important benefits of fasting six days of Shawaal is that is makes up for any shortfall in a person’s obligatory Ramadhan fasts, because no one is free of shortcomings or sins that have a negative effect on his fasting. As the Prophet (peace and blessings of Allaah be upon him) said:
“The first thing for which people will be brought to account on the Day of Resurrection will be their salah (prayer). Our Lord, may He be glorified and exalted, will say to His angels – although He knows best – ‘Look at the salah of My slave, whether it is complete or incomplete.’ If it is perfect, it will be recorded as perfect, and if something is lacking, He will say, ‘Look and see whether My slave did any voluntary prayers.’ If he did some voluntary prayers, [Allah] will say, Complete the obligatory actions of My slave from his voluntary actions.’ Then all his actions will be dealt with in a similar manner.” (Narrated by Imam Abu Dawood).
Sheikh Muhammed Salih Al-Munajjid (https://islamqa.info/en/7859)