To reflect the $500 that has been applied to the loan balance, debit the loan account. (Since it is a liability account, a debit will reduce it is balance, which is what you want.) The $40 interest paid is an expense, so debit the expense account called Interest.