Siman 578
Presented here for study, not as a practical ruling. The Shulchan Aruch rules by Sephardi custom, the Rema's glosses by Ashkenazi custom, and the Kitzur follows Ashkenazi custom. For a practical question, ask your rabbi.
א כְּשֵׁם שֶׁהַצִּבּוּר מִתְעַנִּים וּמִתְפַּלְּלִים עַל צָרָתָם, כָּךְ כָּל יָחִיד מִתְעַנֶּה וּמִתְפַּלֵּל עַל צָרָתוֹ. כֵּיצַד, הָיָה לוֹ חוֹלֶה אוֹ תּוֹעֶה בַּמִּדְבָּר, אוֹ חָבוּשׁ בְּבֵית הָאֲסוּרִים, יֵשׁ לוֹ לְהִתְעַנּוֹת וּלְבַקֵּשׁ רַחֲמִים בְּתַעֲנִיתוֹ; וְלֹא יִתְעַנֶּה בְּשַׁבָּת וּמוֹעֵד, חֲנֻכָּה וּפוּרִים וְרֹאשׁ חֹדֶשׁ.
1 "That every individual should fast and pray for their distress. In one section: Just as the community fasts and prays for their troubles, so too, each individual should fast and pray for their own distress. For example, if one is sick, lost in the wilderness, or imprisoned in a prohibited place, they should engage in fasting and seek mercy during their fast. However, one should not fast on Shabbat, Festivals, Chanukah, Purim, and Rosh Chodesh.