If you think of the accounting equation, Assets = Liabilities + Owner's Equity, assets are on the left side of the equal sign and assets will normally have their account balances on the left side or debit side. Owner's equity is on the right side of the equal sign and owner equity accounts will normally have their balances on the right side or credit side.
If a company pays $800 for the current month's rent, the company's assets and its owner's equity will decrease. To decrease an asset such as Cash, the company will credit the Cash account for $800. Since every entry must have debits equal to credits, the company will need to debit another account for $800. In this case it needs to debit the account Rent Expense. Eventually the debit balance in the Rent Expense account will be transferred/closed to another owner equity account. (The owner equity account might be a proprietor's capital account or a corporation's retained earnings account).
If the company earns and receives $300 for providing a service, the company's assets and owner's equity will increase. The asset Cash will be increased with a debit of $300. Therefore another account will need to be credited. In this case Service Revenues will be credited for $300. Service Revenues is a temporary account that will eventually be closed to an owner equity account. (Recall that owner equity accounts will normally have credit balances and therefore will be increased by credits.)