I am 24 years old and once for a blood test I was wearing clothes which could not go all the way up till were we had to put the injection. So I took my arm out of the clothes I was wearing. But the problem was my arm was visible from my shoulders so basically all of the arm including my underarms and also my strap of the bra. So now I think of it I feel like I did something wrong showing my arm to a person who is a male and I don’t know him. So can you please tell me if it was wrong and will I be punished. Thanks.
I assume this test was necessary in that case if you had the possibility to chose whom would take the blood or chose a surgery with only female staff and if a mahram was present everything is fine.
This fatwa islamweb #8107 -in Arabic- offers statement of scholars of different fiqh schools here a statement of Izz al-Din ibn 'Abd al-Salam from his 'Qaw'id al-Ahkam:
In the following I will translate from Arabic, this is my own translation take it with the necessary care
ستر العورات واجب، وهو من أفضل المروءات، وأجمل العادات، ولا سيما في النساء الأجنبيات، لكنه يجوز للضرورات والحاجات.
Hiding the 'awrah (the private parts) is orderd (wajib) and it is among the best senses of honor and customs. Especially in front of foreign women, but it is allowed in case of necessity and demand.
أما الحاجات: فكنظر كل واحد من الزوجين إلى صاحبه... ونظر الأطباء لحاجة الدواء...
As for the necessities among them is for example each of the spouses looking at the other ... and the doctor to look at a sick person in order to heal him/him
وأما الضرورات: ... ومداواة الجراحات المتلفات، ويشترط في النظر إلى السوءات لقبحها من شدة الحاجة، ما لا يشترط في النظر إلى سائر العورات.
And among the demands is for example ... healing damaged wounds, but its necessary for looking at these shams for its ugliness due to the need, what is necessary for looking at all other 'awrat (plural 'awrah).
وكذلك يشترط في النظر إلى سوأة النساء من الضرورة والحاجة ما لا يشترط في النظر إلى سوأة الرجال، لما في النظر إلى سوءاتهن من خوف الافتتان، وكذلك ليس النظر إلى ما قارب الركبتين من الفخذين، كالنظر إلى الأليتين
And the conditions for looking at the shame of a woman (for men) due to necessity or demand are higher than those for looking at the shame of a man (for men), due to the fact that looking at it may cause trial (or attraction), and also looking at what is close to the thighs or knees the same as looking at what is between the bottom cheeks.
(Source Qawa'id al-Ahkam fi Masalihi al-Anaam)
Else you should avoid doing this again and repent. Also you should follow the above recommendations/instructions the next time!