As far as the ATM, somewhat simple if you know what you're doing. Basically, you have the ATM event, then if you want it where you automatically lose all of your money, go into "change gold" and make it set to a variable for the player's gold. Then make a variable for the bank's gold and set it to the player's gold.
If you have it where the player can choose how much they want to deposit, that's going to be a bit trickier, because you'll probably need a visual component to actually show that the player is losing/gaining money. But as far as the technical stuff goes, it's basically the same, but you have to check for player input. Here's the event format for the whole thing.
Show Text: Press the up button to take money, press the down button to deposit money. \$
Conditional Branch: up button is being pressed
Conditional Branch: bank > 0
Control Variables: gold += 1
Control Variables: bank -= 1
Else
Play SE: buzzer
Show text: "There is no money in the bank."
Branch End
Conditional Branch: down button is being pressed
Conditional Branch: gold > 0
Control Variables: gold -= 1
Control Variables: bank += 1
Else
Play SE: buzzer
Show text: "You have no money."
Branch End
As far as losing money after dying, it depends on how you have your battles set up. If it's a random encounter, you'd need a common event triggered when the party is defeated. If it's predetermined (i.e. setting up battles via event commands), you set it to "continue if lose", subtract the amount of gold the player has / 2 (you would need to make a variable command prior to doing that though, which sets another variable = the player gold variable / 2) Then you go to the game over screen immediately after.