The balance sheet is at the centre of bookkeeping. The balance sheet shows assets and liabilities at a given point in time, i.e., it shows what a company owns and owes. The entries on the balance sheet are general ledger accounts, or in a somewhat more complicated accounting setup: totals of groups of general ledger accounts.
Accounting or bookkeeping means: keeping track of changes in assets and liabilities. Thus it is possible to create a new balance sheet after some time, for example after a posting year.
Assets (what the company owns) are at the left side of the balance sheet. These are the debit entries. Liabilities (what the company owes) are at right side of the balance sheet.
Examples of assets are: buildings, machinery, but also receivables with respect to other parties, such as debtors or banks.
Examples of liabilities are: bank credits, creditors (accounts payable), VAT (value added tax) to be paid to the tax office, fiscal retirement reserve.
A special type of credit entry is the proprietor’s capital or owner’s equity. This is a liability of a one man business with respect to its owner. That’s why it is at the credit side of the balance sheet.
The total of all the debit entries in the balance sheet must always equal that of all credit entries.
A bank statement is essentially a copy from the books of the banks. That is why debit and credit are reversed on it: what is a receivable (debit) from the point of view of the bank, is a debt (credit) for the account holder. A receivable (positive balance, debit) for the account holder is a debt (credit) for the bank. This explains why “to be in the red” is expressed as a debit balance on a bank statement. A positive balance on the bank statement is debit on the account holder’s own books.
Profit or loss is a change in the equity. In order to determine it, records are kept of all changes in assets and liabilities. The account “Equity” itself is not changed all the time. Instead there are auxiliary accounts of Equity: expense accounts and revenue accounts. These accounts are not part of the balance sheet, but transactions are booked for them.
Expenses are entered as debit, because eventually, they will reduce equity. Equity is on the credit side, so a reduction of equity is debit.
Revenues are entered as credit, because eventually they will enlarge equity. Equity is on the credit side, so enlarging it is credit.
The balance of revenues and expenses is the profit. At the end of the booking year this is visible on the income statement (profit and loss statement).
It is fascinating to realise that this bookkeeping method isn’t modern at all. It is over 500 year old. Yet, it is still the basis of every modern accounting system. Further reading about the history of accounting:
The German words for debit and credit are: Soll and Haben (haben = have). This seems strange, because debit represents what you own, what you have. That’s debit and not credit (German: Haben). Perhaps it can be explained by what the word credit means in Latin: “he handed over in trust” or rather “he hands over in trust”. This can be linked to the German word “Gläubiger” (literal meaning: believer), which means creditor. Creditors are people who believe that the goods or money that they made available to some other person or company, will one day be returned to them.
Debit means "he must (still pay)", in German: er soll noch bezahlen. The Duden dictionary (Universalwörterbuch) explains “Haben” as a shortening of “Er soll haben”, which only seems to add to the confusion.
In the German Wikipedia articles about Soll and Haben, referring to a German translation of the original book by Luca Pacioli, the words are explained from the Italian expressions “deve dare” (must give) and “deve avere” (must have). In German they later deleted the giving part at the left, and the obligation (must) at the right.