Question:

What’s the ruling of working in a bank and does it nullify any of your actions?

Answer:

The lajnah were asked a similar question to which they responded:

First: We have already issued Fatwa no. 4961 [found here] regarding working in a bank that deals in Riba (usury or interest). It states that if the bank does not deal in interest bearing transactions, the salary or the bonus an employee receives for work is Halal (lawful), for earning it through lawful work.On the other hand, if the bank deals in Riba, the salary or the bonus an employee receives for work is Haram (unlawful), because of their cooperating with the owners of these Riba-based banks in sin and transgression. Allah says (what means):

Help you one another in Al-Birr and At-Taqwâ (virtue, righteousness and piety); but do not help one another in sin and transgression.

It is also narrated that:

The Messenger of Allah (peace be upon him) cursed the one who consumes (takes) Riba (usury or interest), the one who pays it, the one who writes it down and the two who witness it. He (peace be upon him) said, “They are all equal.”

Related by Muslim.

Second: If a believer is afflicted with an illness, or any other kind of hardship, this will help expiate some of their sins, because the Prophet (peace be upon him) stated:

No calamity befalls a Muslim but that Allah expiates some of his sins because of it, even though it were the prick he receives from a thorn.

Related by Ahmad, Al-Bukhari, and Muslim.

It is also reported that the Prophet (peace be upon him) said:

Verily, the greatness of reward is commensurate with the greatness of trial. And indeed, when Allah loves a people, He tries them (by affliction). Whoever is content (with Allah’s Decree) will win His Good Pleasure, but whoever is discontent (with Allah’s Decree) will earn His Wrath.

Related by Al-Tirmidhy.

This is for the believers. As for the disbelievers, sickness is a kind of worldly accelerated punishment. According to the more correct of the two opinions held by the scholars, a person who abandons Salah is considered a Kafir (disbeliever).
May Allah grant us success. May peace and blessings be upon our Prophet Muhammad, his family, and Companions.

[Reference]