It can happen when you take a deep breath and push down but don't allow yourself to breathe out. You may do this, for example, when you have a bowel movement or empty the bladder. It can happen when you cough hard or long. Your body may react to these efforts with a reflex that slows the heartbeat. Your blood pressure then decreases and you may faint.
Some people are especially sensitive to changes in position and prolonged standing.
This type of fainting is called neurocardiogenic syncope. Sometimes heart problems cause fainting. Irregular heart rhythms are the most common. Abnormal heart valves can also cause drops in blood pressure that lead to fainting. Fainting can be a side effect of some medicines.