I have read that banks don't really need deposits to make loans but rather it is the other way round. I thought that banks could only lend out money that customers deposited. If this is the wrong idea, then where do banks get the money to loan out in the first place?
This part of the page you linked may be an accurate description of double-entry bookkeeping, but it is an inaccurate description of the world.
When a bank makes a loan, there are two corresponding entries that are made on its balance sheet, one on the assets side and one on the liabilities side. The loan counts as an asset to the bank and it is simultaneously offset by a newly created deposit, which is a liability of the bank to the depositor holder. Contrary to the story described above, loans actually create deposits.
In reality, you can also create a loan by authorizing an outgoing payment, either writing a check against a line of credit, or a transaction purchasing a house or car. The funds are not "on deposit" where the accountholder can withdraw them at will. The check/payment will be deposited by the seller... but that deposit is not in the account of the borrower as the above paragraph claimed. And even there, the funds are likely to spend more time clearing the payment system than they do sitting in the recipient's account.
Even in other cases (unsecured loans aka "cash advances", or loans secured by existing collateral) the "deposit" into the borrower's account is very short-lived. And the money in that account does no good for the bank's reserve requirement, because it's being paid out almost instantly.
It's all a mistaken attempt to explain the real point they are trying to make which is
The reality is that banks first extend loans and then look for the required reserves later.
That has nothing to do with "creation of a deposit".