Let's say someone was doing vrat for the whole duration of Navratri. Then there is a a death in the family during this period. Should the person continue the fast or not? Is there a proper method mentioned to come out of fast in such conditions?
Yes, some fast must be continued even during the Aśauca (अशौच).
We can't conclusively say about other fasts, but we do have a very clear scriptural injunction for the Ekādaśī fasts, being immune to all forms of impurity.
Garuḍa Purāṇa, Chapter 123 - Kārtika Vratas
दशम्येकादशी यत्र तत्रस्थाश्चासुरादयः ।
द्वादश्यां पारण कुर्यात्सूतके मृतके चरेत् ॥ १,१२३.१३ ॥
- The performance of an Ekādaśī Vrata is never affected by the personal uncleanness incidental to the death or birth of one's agnates.
English Translation by Manmatha Nath Dutt.
Besides, there's a general rule that if a vow (vrata) has been undertaken beforehand with a Saṅkalpa (सङ्कल्प), then impurities arising from a birth or death cannot be considered an impediment. This is true for pre-determined marriages too.
This is what, the Agni Purāṇa states on pre-determined vratas (vows):
Agni Purāṇa, Chapter 175 - Vrata-Paribhāṣā
सूतके मृतके कार्त्यं प्रारब्धं पूजनोज्झितं ॥ १७५.०४२.क ॥
- (a). A worship that has been begun should not be discontinued when (a pollution is caused) by the birth (of a child) or by the death (of some relative).
English Translation by N. Gangadharan
Proper method to come out of the fast?
As one can see, pre-determined vows can be sustained even during impurity period, as discussed above. In some cases, especially for menstruating women, the scriptures also provide for alternatives like requesting a proxy to perform a vow on one's behalf through the "designated - person" such as husband, son et al.
आरब्धदीर्घतपसां न राजा व्रतहा स्त्रियाः । गर्भिणी सूतिका नक्तं कुमारी च रजस्वला ॥ ३९ ॥
यदाशुद्धा तदान्येन कारयेत क्रियाः सदा । क्रोधात्प्रमादाल्लोभाद्वा व्रतभङ्गो भवेद्यदि ॥ ४० ॥
दिनत्रयं न भुञ्ञीत मुण्डनं शिरसोऽथ वा । असामर्थ्ये व्रतकृतौ पत्नीं वा कारयेत्सुतं ॥ ४१ ॥
39-41. A king should not obstruct the vow of those who had undertaken a prolonged penance or of a woman. If a pregnant woman or a woman who has delivered a child or a girl who is in her monthly course becomes impure after beginning a long vow she may arrange always to do the same by someone else. If the vow is broken on account of anger or mistake or greed, one should not eat for three days. Otherwise, one should shave his head. If a person who practises a vow is unable to continue, his wife or son may be made to continue it.
Chapter 175 - Vrata-Paribhāṣā
Garuḍa Purāṇa also says the same thing.
प्रारब्धतपसा स्त्रीणां रजो हन्याद्व्रतं न हि । अन्यैर्दानादिकं कुर्यात्कायिकं स्वयमेव च ॥ १,१२८.१८ ॥
क्रोधात्प्रमादाल्लोभाद्वा व्रतभङ्गो भवेद्यदि । दिनत्रयं न भुञ्जीत शिरसो मुण्डनं भवेत् ॥ १,१२८.१९ ॥
असामर्थ्ये शरीरस्य पुत्रादीन्कारयेद्व्रतम् ॥ १,१२८.२०.ख ॥
A female vowist menstruating after taking the vow is not disqualified from practising it to term in consequence. The Vratas may be practised through a proxy, but penances must be personally performed. A vow broken through anger, greed, or incontinence, should be atoned for by a three days’ fast and a clean shave of the head. The performance of a Vrata may be delegated to one’s son in case of one’s ill health.
Chapter 128, Bṛhaspati (Nītisāra) Saṃhitā
If vow (vrata) has been undertaken beforehand with a Saṅkalpa (सङ्कल्प), especially the vows concerning the Ekādaśī fasts, then such fast may be continued even during Aśauca period.