If a transaction is declined, the merchant or ATM will notify you. To avoid this kind of situation, remember to check your balance regularly.
If your card is still declined despite having funds on it, make sure that you have not exceeded the purchase or withdrawal limit (see limit terms and conditions).
Finally, make sure that a prior withdrawal authorisation has not blocked a larger amount than expected. This is the case, for example, with automatic fuel dispensers that block a larger amount on your card than the final purchase amount. This amount remains blocked on your card until final payment is made (which can take up to 14 days).