Before a woman who is a Nidda begins the "Shiba Nekiyim" ("seven clean days") that she observes before immersing in a Mikveh, she must perform a special inspection called the "Hefsek Tahara." This inspection must be done on the day before the woman begins observing the seven days, in order to establish that the bleeding has completely ceased. Thus, for example, a woman can begin observing the "Shiba Nekiyim" on Tuesday if she performs an inspection on Monday to establish the cessation of bleeding.
The Hefsek Tahara inspection should preferably be performed within 2.5 Halachic hours before sundown. This would mean that if the sun rises at 6am and sets at 6pm (such that each Halachic hour is sixty minutes long), the Hefsek Tahara should be performed at some point between 3:30pm and 6pm. Nevertheless, the Hefsek Tahara is valid even if it is performed earlier, and even in the morning. Therefore, if a woman knows ahead of time that she will be unable to perform the inspection in the afternoon, she may perform it in the morning, and the following day will then count as the first of the "Shiba Nekiyim."
If a woman forgot to perform the Hefsek Tahara inspection before sundown, she may do so after sundown, during the period of "Ben Ha’shemashot," or approximately ten minutes after sundown. Although Halacha requires performing the Hefsek Tahara before sundown, a woman who remembered only at or after sundown, or was unable to perform the inspection earlier, may still perform the inspection, provided that she is within ten minutes after sunset. It is incumbent upon the husband to remind his wife to perform the Hefsek Tahara inspection. Modern technology has made this responsibility easier, as the husband can simply send a text message or call his wife on the cell phone to remind her.
If a woman recited Arbit before sundown (as many people do on Friday evening during the summer months), she may nevertheless perform the Hefsek Tahara inspection after Arbit. Even though she has recited Arbit, we do not consider night to have begun, and she may therefore perform the Hefsek Tahara, until sundown. Similarly, a woman may perform the Hefsek Tahara before sundown on Friday afternoon even after she had lit candles and accepted the onset of Shabbat. Even though she has begun Shabbat, it is still considered daytime and she therefore still has the opportunity to perform the Hefsek Tahara.
Summary: The Hefsek Tahara inspection is required to establish the cessation of menstrual bleeding, thereby enabling the woman to begin observing the "Shiba Nekiyim" ("seven clean days") that must be observed before immersion. The inspection should preferably be done within 2.5 hours before sundown, but if necessary it can be done even earlier. If a woman forgot or was unable to perform the inspection before sundown, she may do within ten minutes after sundown. A woman may perform the inspection before sundown on Friday afternoon even if she had already recited Arbit or accepted Shabbat.
In all cases a competent Rabbi should be consulted.