Answer
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.
In this fatwa:
If the trader whose store you are guarding mostly deals in permissible things, and you are not directly helping with something that is haram – such as carrying it or recording it in the ledgers – then there is nothing wrong with you carrying on with this work as a security guard.
Answering your question, the Fatwa Center at Islam Q and A, states:
There is nothing wrong with working as a security guard for shops and stores that sell permissible things, clothing and otherwise, but it is not permissible to work as a security guard for places that are built for haram activities, or where the majority of what goes on in them is haram, such as riba-based banks, bars, gambling venues, dance halls and the like, because of the prohibition on helping others to commit sin.
Allah says:
{And cooperate in righteousness and piety, but do not cooperate in sin and aggression. And fear Allah ; indeed, Allah is severe in penalty.} (Al-Ma’idah 5:2)
It says in Fatawa al-Lajnah ad-Da’imah (14/481): Is it permissible for a Muslim soldier to guard churches, bars, cinemas or entertainment venues such as casinos and places where alcohol is sold?
Answer: It is not permissible to work as a guard protecting churches, bars, and entertainment venues such as cinemas and the like, because that comes under the heading of helping in sin, and Allah has forbidden cooperating in sin.
If the trader whose store you are guarding mostly deals in permissible things, and you are not directly helping with something that is haram – such as carrying it or recording it in the ledgers – then there is nothing wrong with you carrying on with this work, based on what is mostly the case.
That is because the presence of some haram things among the goods sold is a problem that is widespread and difficult to avoid, and the basic principle is that what is secondary may be overlooked and forgiven in a manner that is not applicable in other cases.
And because you mentioned that this work makes it easy for you to pray on time and let your beard grow.
Almighty Allah knows best.
Source: www.islamqa.info