Distress signals are used when a boat or a crew member are in grave and immenent danger and require immediate assistance.
Several devices can be used to attract the attention of possible rescue units: a radio, an EPIRB, a radar transponder, pyrotechnics, flags, and signals.
Which device is the best to use depends on the circumstances. If the visibility is good and the rescuers are close by, you could use hand flares, or if you are far away from land maybe it is best to activate the EPIRB.