To be able to record a purchase on account, one would have debit the asset account that is being purchased and credit the accounts payable account.
So, from the image, since the merchandise is being purchased on account, then you would debit the Merchandise Inventory account and credit the Accounts Payable account.
The journal entry for the purchase on January 9 would be look like:
Date Account Titles Debit Credit
Jan 9 Merchandise Inventory 6,100
Accounts Payable 6,100
So, in the second table, to record the payment of freight on January 20, one would have to debit the Freight Expense account and then credit the Cash account.
So, the journal entry for the payment of freight on January 20 would look like:
Date Account Titles Debit Credit
Jan 20 Freight Expense 100
Cash 100