When you first learn about debits and credits, you learn by recording them in t-accounts. T-accounts are used by accounting instructors to teach us how to do accounting transactions. T-accounts show which side of the ledger debits and credits go for a particular business transaction. In actuality, accounting transactions are recording by making accounting journal entries. Just like everything else in accounting, there is a particular way that you make an accounting journal entry when it comes to recording debits and credits.
Debits are recorded on the first line, flush with the margin. Credits are recorded on the second line and are indented a couple of spaces. Simple as that.
Next step: How debits and credits are recorded for an asset account