Generally credits are posted before debits. So if they arrive on the same business day you should have funds to pay the debit. But if the debit arrives before the credit you will not have sufficient funds and will be charges and nsf fee.
That is called deposit roulette
Yes, the ordrr matters.
If you withdraw more than you have in your account you will be charged. It will be less if the account has an agreed overdraft, but if it doesn't then it will be a lot. And even then, the withdrawal may be cancelled.
The account will go into overdraft, causing the account-holder to get fees for overdrawing the account. Yes, it matters when these transactions occur.
Let's pretend you do your own homework, using what you learned in class, or merely GRADE SCHOOL logic.
I forgot, they don't teach you to think any more. They teach you NOT to think.