May a bank take money from my deposit account to make a payment on a loan that I owe to the bank?

Usually, yes.  Generally, a bank may take money from your deposit account to make a payment on a separate debt that you owe to the bank, such as a car loan, if you are not paying that loan on time.  This is called the right of offset.

In some situations, the bank can exercise the right of offset without letting a customer know in advance that it is going to do it.

However, federal law limits what a bank can do in some cases.  For example, federal law won’t allow a bank to offset your deposit account to pay off your consumer credit card account.