This may be a vasovagal attack, also known as vasovagal syncope. It may occur at times of great emotional stress or in response to the sight of blood. Vasovagal attacks can happen to some people with little notice, but there are ways to prevent spells from occurring.
https://www.doctorshealthpress.com/general-health-articles/vasovagal-attack-syncope/