Wa `alaykum as-Salamu wa Rahmatullahi wa Barakatuh.
In the Name of Allah, Most Gracious, Most Merciful.
All praise and thanks are due to Allah, and peace and blessings be upon His Messenger.
1- It’s the duty of Muslims, males and females, to abide by the dictates of morality and decency everywhere.
2- In public transports, men should avoid coming into close contact with women.
Answering the question, Sheikh Ahmad Kutty, a senior lecturer and an Islamic scholar at the Islamic Institute of Toronto, Ontario, Canada, states:
In situations such as the one you are facing, you must consider whether you have any other options to take in order to avoid such close encounters with members of the opposite sex.
Consider the possibility of changing your work hours, or changing your route to work, or even changing the time of travel by preferring to travel in less crowded times.
If any of the above options are available, you must try it out.
If, however, you are faced with no reasonable option, then you may travel, provided you do everything possible to shift your focus away from thinking of the members of the opposite sex.
Concentrate on dhikr and istighfar and discipline your mind in such a way that it would not make a difference for you whether you are standing beside a piece of furniture or a member of the opposite sex.
By doing your best to do what is within your means and ability, you have fulfilled your religious duty, the rest is with Allah. Allah reassures us in the Qur’an,
“Allah does not impose on anyone a duty that he has no strength to bear.” (Al-Baqarah 2:286)
We are told to fear Allah as best as we can.
Finally, continue to seek Allah’s help in guarding yourself against temptations of all kinds. Allah says,
“Whosoever puts his trust in Allah, Allah suffices him.” (At-Talaq 65:3)
Never forget to say the duaa taught by the Prophet (peace be upon him) when venturing out into the world of temptations.
Here are the two main duaas we are required to recite while venturing out. They will definitely prove to be tremendous source of spiritual empowerment for believers in all walks of life:
Bismillaahi tawakkaltu `ala Allaah, laa hawla walaa quwwata illaa bilaah.
(In the name of Allah, I place all my trust in Allah; there is no power to shun evil, nor strength to earn good except with Allah’s assistance).
Allaahumaa innee ‘a`udhu bika an adillaa aw udalaa aw azilla aw uzalla, aw ajhala or unjhala `alayya.
(O Allah, I certainly seek refuge in You from leading people astray or being led astray, from slipping up or being led to slip up, or acting foolishly or others acting foolishly towards me).
The Prophet (peace be upon him) reminded us that by praying we will become protected, and empowered.
Allah Almighty knows best.