When learning accounting for the first time, the terms 'credit' and 'debit' can be a little confusing. Why? Because if you visit the bank and deposit money, the teller will tell you, "I am crediting your account X amount of dollars," but if you are withdrawing money our of your account, the teller will tell you, "I am debiting your account X amount of dollars." Also, with debit machines all over the place, and everyone is using credit cards, the two accounting terms have a whole new meaning.
However, these two terms are so important in the accounting world, credit and debit, have to be unlearned quickly. Why? Because in accounting, the term debit is used to describe a bank account and that money owed are actually credit accounts - the exact opposite of what we have been taught elsewhere.
In accounting terms, neither credits nor debits are 'bad' but they need to equal each other in order to balance themselves out in the end. Every itemized transaction, no matter if it's a deposit or a bill to be paid has both a debit and credit posted in the accounting world. This is what is called 'double-entry accounting' so when you go to the bank, and the teller says, "I am crediting your account X amount of dollars," she is also debiting an entry of a similar amount without telling you this. The same goes for when the teller tells you, "I am debiting your account X amount of dollars," the accounting will show that a credit of the same amount is being made elsewhere at the same time.
People learning about credits and debits can be easily confused by the banks in the accounting sense of the words, especially when discussing liability. For example, when you deposit money in the bank, the bank's liability to you increases, and since liabilities are credits, they are crediting your account (in accounting terms). And when the bank lowers their liability to us (by us withdrawing money out of the bank) the banks are debiting the liability account, from an accounting perspective.
The easiest way to figure out credits and debits in accounting terms is to figure out the following: where did it come from, and what did you receive. In accounting terms: the debit is what you received, and the credit is where you received it from. So for demonstration sake, let's say you bought a book with your credit card. The book is what you got, so it will be a debit in the accounting term, and the credit will be applied to the liability you carry on your credit card for the exact same amount.
Basically it comes down to being able to figure out what you received and where exactly it came from; if you can figure these out for every transaction, then you've got the accounting terms of debit and credit down pat.