When you progress in the first part of the island, you will gain access to the first ATM when you have saved all of the crabs (feed them the yellow fruit from the trees by shooting it at them).
You can shoot money into these ATMs - any money you pull out and shoot back in also counts toward the achievement!
If you have 50 Dubloons, you can withdraw them all by sucking them out of the machine and deposit them 10 times for the 500 Dubloons achievement and 20 times for 1,000 Dubloons.
Good luck!