This is the document version of the question: not what the code is, but which corner of which piece of paper it sits in. The answer differs by country and by document, and one of the four common sources is far less reliable than the other three. Going through them in order saves a great deal of squinting at small print.
On a statement
A statement is the most complete single source, because it carries several identifiers at once. A UK statement header carries the sort code, the account number, the account name and the bank's registered office, and statements for accounts used internationally often carry the IBAN and BIC as well. A US statement carries the account number and usually the routing number, though some banks print only the number used for direct deposit and leave the wire routing number to a separate page.
On a cheque
A US cheque carries the routing number as the first nine digit block along the bottom, then the account number, then the cheque number. The ordering is standardised, which is why banks are comfortable publishing a diagram of it. A UK cheque carries the sort code and account number in the machine readable band along the bottom, and the sort code is also usually printed in the top right. Neither carries a BIC, which is not a domestic field.
On a card, which is the weak source
This is where the question usually starts and it is the least reliable place to look. Older UK debit cards printed the sort code and account number under the cardholder name; many current cards print nothing, and some print nothing on the front at all. US cards have never carried a routing number. The long number across a card is a card scheme number and is not an account number, and no bank transfer will accept it as one.
In the app, which is the strongest
The app reads the live record, which none of the paper sources do. Every major bank's app has a screen built for handing your details to a payer, and most will copy them to the clipboard so nothing is transcribed by hand. In a UK app the domestic and international details are usually on separate tabs. In a US app, read carefully whether the routing number shown is for direct deposit or for wires, because giving the wrong one causes a return rather than a misdelivery.
Questions people ask about where to find bank identification code
Is the code on my bank card?
Sometimes in the UK on older cards, and never in the US. Many current UK cards print no account details at all as a fraud measure.
Where is it on a US cheque?
The routing number is the first nine digit block along the bottom of the cheque, to the left of the account number.
Does a statement always show it?
A UK statement header carries the sort code and account number. US statements vary, and the wire routing number is often on a separate page of the bank's site.
Which source should I use if they disagree?
The app, or the bank itself. Paper sources go stale when a product is migrated, and a card can be older than the account details it shows.