I want to invest in a bank's share, but I know the bank earns interest as a source of income. But it does have other sources of income too. Will it be haram for me to invest in it knowing that it earns interest?
It is haram to invest when there is interest involved. Interest is called riba in arabic and interest on investment or loan is called riba an-nasiya which means an excess charged for a loan in cash or kind which is haram. As for your condition, if you do not make interest on your investments, you can do business with them as long as you follow shria.
Riba is most often translated as usury as in:
O ye who believe! Devour not usury, doubling and quadrupling the sum lent. Observe you duty to Allah, that ye may be successful (Q.3:30)
Riba can also be translated as unjust and exploitative financing. And this is of one piece of the usual understanding of usury, which is extorting exploitative rates of finance. Notice that the verse says - doubling or quadrupling the capital. This is not going to happen with a rate of interest of say 5% too quickly. But can happen very quickly with rates like 150%, or 1200% as some payday lenders charge to financially vulnerable. There are also such funds called vulture funds and debts considered as odious debt as they are considered, on the whole, as having been extorted from a community or a nation.
Hence one ought to scrutinise investments if they follow just principles of investment and not merely investing in funds which are unprincipled and are simply looking for the best return without looking at the larger societal impact this has.
Moreover, this should be understood more broadly in the context of today's investment climate and the how certain investments are just or unjust. Given the emphasis the scientific community has put on Global Warming, one should avoid investing fossil fuels. More, some companies and corporations use sweat house labour further down the supply chain, and one can consider this as riba.
As scrutiny can take time, and to do do properly can take a great deal of time, then it may be useful to engage the services of a thing as Sharia-compliant or Islamic banking service who will help guide you.
And Allah knows Best.