Based on the double entry system, the assets need to always equal the liabilities plus the capital and the reserves. Based on that, when a transaction takes place, there needs to be a debit and an equal credit.
A debit will increase the assets and the expenses while the credit will increase the liabilities, the equity and the revenue.