Islamically Permissible and Prohibited Jobs in the West
Question

How can I know what work is prohibited and what is lawful? Because here in Germany there are many jobs that are unlawful or dubious. Many times I have read that if someone works in a place where alcohol or pork are sold, it is unlawful for him to work in that place. 
But two or three weeks ago, someone asked you about working in a bakery, and the bakery belongs to a restaurant in which there may be pork or alcohol, and you told him that it is permissible for him to work there, because he is in a non-Muslim country.
How can I know the guideline, and how can I know whether I am in need or have no choice? My friend works in a bakery and he deals with cheese only, and other people deal with pork, but he does not go anywhere near the pork or touch it. Is his work permissible, and is it permissible for me to go to his house if he invites us, and to eat his food? 
Moreover, his wife works in insurance, and I know that this is unlawful. Is what I am doing of refusing to go to his house correct, and if he gives me a gift, should I accept it or not? What should I do with the gift that he gave me a while ago?
If I refrain and do not work in such places, and I try hard to look for a job that does not involve anything unlawful or dubious, or that mixes lawful and unlawful, or that prevents me from praying on time, is this right or not? I am afraid of evildoing; please help me, may Allah reward you with good.
Praise be to Allah.Which jobs are permissible in Islam?
The guideline on permissible work is that it should be in a permissible field and should not involve helping others to commit unlawful acts.
This includes working in buying and selling, and rental, of permissible things such as selling food, medicine, tools and equipment, and the like. It also includes working in teaching, medicine, engineering, electricity, carpentry, and manufacturing, and innumerable other permissible types of work.
Which jobs are Prohibited in Islam?
As for unlawful work , that includes: working in Riba-based banks or commercial insurance companies, or carrying alcohol , or raising pigs , or writing down contracts of Riba, or equipping places for gambling, or selling things that it is thought most likely will be used for unlawful purposes, such as selling weapons to bandits, and other things that are regarded as prohibited and sinful, or helping in it directly or almost directly .
As for helping in it indirectly, whilst not intending to help in sin and transgression, that is not unlawful. That includes selling permissible food to a disbeliever, one who deals in Riba, or one who gambles. It cannot be said that by means of this food one is nourishing them and giving them the strength to commit sin. If indirectly helping them was forbidden, then people would never find permissible work except in very rare cases.
Hence the Companions used to deal with the Jews, buying and selling, renting, and so on, because they benefited from such activities.
If the work in and of itself is permissible, and does not involve directly helping anyone to commit unlawful acts, it is permissible.
This is the guideline that we can mention in this regard, with regard to whether work is lawful or prohibited.
Based on that, if there is a bakery that sells permissible types of bread, and other types that are unlawful because they are contain alcohol, for example, and the worker’s role is limited to dealing with the permissible bread, and he is not helping with that which is unlawful in any way, then in the case of extreme need it is permissible for him to do this job, but he should look for other work, because seeing the evil deed makes it obligatory for him to object to it, and he may not be able to do that. So he should leave the place in that case, because Allah, may He be exalted, says (interpretation of the meaning):
“And it has already come down to you in the Book that when you hear the verses of Allah [recited], they are denied [by them] and ridiculed; so do not sit with them until they enter into another conversation. Indeed, you would then be like them. Indeed Allah will gather the hypocrites and disbelievers in Hell all together.” [An-Nisa’ 4:140]
Al-Jassas (may Allah have mercy on him) said in Ahkam Al-Quran (2/407): 
“This verse indicates that it is obligatory to express the objection to an evil deed to the one who is doing it, and that part of objecting to it is expressing displeasure, if it is not possible to remove it, and to refrain from sitting with the one who is doing it, and to get up and leave him, until he stops doing that and begins to do something else.”
Shaykh Ibn ‘Uthaymin (may Allah have mercy on him) was asked: What is the ruling on working for the owners of shops selling gold, in which they engage in transactions that are Islamically unacceptable, whether that is dealing with Riba, using prohibited tricks, deceiving customers, and other transactions that are not acceptable according to shari‘ah?
He (may Allah have mercy on him) replied: 
“Working for these people who deal in Riba, use deceit, and other prohibited things is prohibited, because Allah, may He be exalted, says (interpretation of the meaning):
“but do not cooperate in sin and aggression.” [Al-Ma’idah 5:2]
“And it has already come down to you in the Book that when you hear the verses of Allah [recited], they are denied [by them] and ridiculed; so do not sit with them until they enter into another conversation. Indeed, you would then be like them. Indeed Allah will gather the hypocrites and disbelievers in Hell all together.” [An-Nisa’ 4:140]
And because the Prophet (blessings and peace of Allah be upon him) said: ““Whoever among you sees an evil action, then let him change it with his hand [by taking action]; if he cannot, then with his tongue [by speaking out]; and if he cannot, then with his heart [by hating it].” But the one who works with them is not changing anything, whether with his hand, his tongue or his heart, so he is disobeying the Messenger (blessings and peace of Allah be upon him).” (Fiqh wa Fatawa Al-Buyu‘, p. 392)
So this friend of yours should look for another job in which he will be able to avoid seeing evil.
But so long as he does not go near the pork or help with it in any way, then his salary is lawful, because it is in return for his work with the permissible bread, but he is sinning by not objecting the evil, and this is what makes it necessary for him to look for another job.
Thus you will know that there is nothing wrong with you eating his food or accepting his gifts, for his salary is permissible.
Can you work in commercial insurance companies?
Working in commercial insurance companies is prohibited, because commercial insurance is based on Riba (usury) and gambling .
But with regard to wealth that is unlawful because of the manner in which it is acquired, it is only prohibited for the one who acquires it; so there is no blame on the one who takes it from him in a lawful manner, such as gifts, maintenance and the like.
Based on that, there is nothing wrong with you eating food or accepting anything of the wealth of the one who works in this unlawful insurance field.
Thirdly:
How to earn lawful money
The ways of earning a lawful income are many, but the matter may need some research and effort. Whoever fears Allah, may He be exalted, He will grant him provision and help him, as He, may He be glorified, says (interpretation of the meaning):
“And whoever fears Allah - He will make for him a way out.
And will provide for him from where he does not expect. And whoever relies upon Allah - then He is sufficient for him. Indeed, Allah will accomplish His purpose. Allah has already set for everything a [decreed] extent.” [At-Talaq 65:2-3]
So strive to look for permissible work, that is free of mixing and seeing evil things. Caution in this regard is something praiseworthy, for whoever strives to avoid dubious matters will protect his religious commitment from shortcomings and will protect his honour from slander, and whoever falls into doubtful matters will soon fall into prohibited matters.
The Prophet (blessings and peace of Allah be upon him) said:
“Whoever guards against the doubtful matters will protect his religious commitment from shortcomings and will protect his honour from slander, but whoever falls into that which is doubtful will fall into that which is prohibited, like a shepherd who grazes his flock around prohibited land; he will soon graze in it.” (Narrated by Al-Bukhari, 52, and Muslim, 1599)
And he said: “Leave that which makes you doubt for that which does not make you doubt.” Narrated by At-Tirmidhi (2518) and An-Nasa’i (5711). At-Tirmidhi said: This is an authentic Hadith. It was classed as authentic by Al-Albani in Sahih At-Tirmidhi.
And Allah knows best.