What is a Hijab?
Some people say that it's modesty. That is true but it can do other stuff aswell. All muslim ladys or girls have to wear it outside or in a Mosque . It is a shield. If you don't put it on then it is haram. So if you are wearing it you can not show a inch of your hair not even a little bit in front of men. But if you are in the girls toilet or in a room full of girls then you can take it of . Or if you are with you cousins who are boys you can take it of. But if you have a valid reason of taking of you Hijab due to health issues then yes you can take it of.
يَـٰٓأَيُّهَا ٱلنَّبِىُّ قُل لِّأَزْوَٰجِكَ وَبَنَاتِكَ وَنِسَآءِ ٱلْمُؤْمِنِينَ يُدْنِينَ عَلَيْهِنَّ مِن جَلَـٰبِيبِهِنَّ ۚ ذَٰلِكَ أَدْنَىٰٓ أَن يُعْرَفْنَ فَلَا يُؤْذَيْنَ ۗ وَكَانَ ٱللَّهُ غَفُورًۭا رَّحِيمًۭا ٥٩
O Prophet! Ask your wives, daughters, and believing women to draw their cloaks over their bodies. In this way it is more likely that they will be recognized ˹as virtuous˺ and not be harassed. And Allah is All-Forgiving, Most Merciful. Holy Quran 33:59