For the double entry accounting, you should start from the accounting equation which is:
Assets= Liabilities + Capital
For each transaction that the company makes, there should be a debit and an equivalent credit as the equation needs to always hold.
The following accounts are debited when increases:
The following accounts are credited when increased:
For decreases, it is the other way around.