It is a good idea to study accounting. :) Here is a little course on accounting.
An account is a big T with a name referring to an entity you do transactions with.
When you do a transaction with an account then you do a posting. The posting describes the transaction in the language of accounting.
Action of the first kind:
If you take out money from an account then you write the amount to the right side of the T. (In red for now, red meaning a negative number, an amount you owe to the account.)
Action of the second kind:
You put money into the account. Then you write the amount to the left side of the account. (In black, meaning that the account has swallowed your money.)
Every transaction requires two actions (first kind and second kind): You register where the money came from, and you register where the money went to.
I did the accounting based on your story. You can identify the postings.
The balance sheet shows that there is no problem.