It might be making it more difficult by combining it as one entry. Most books do this as two separate entries. And you may have learned it that way, so this is looking weird to you.
The basic idea is that you are reversing out the balance of each of the temporary accounts. Temporary accounts are revenues, expenses and dividends, though this example does not include dividends. "Closing" an account is wiping out the balance it contains so that it becomes zero, so you can start over again for the new year. So all temporary accounts need to have zero balances.
In order to do that, you have to do the opposite of what is in the account. So you have $100,000 in sales revenue. Revenues are credits. So in order to get rid of that $100,000 credit balance and net it to zero, you'd have to debit the $100,000.
Likewise, the expense accounts are debit balances. So to wipe them out and net to zero, you'd have to credit those balances. That's why the two expense accounts are being credited.
You don't even have to know the normal balances. (Though you should anyway of course.) Just look at what is in the account and do the opposite.
Then net it all. You have $100,000 debit, $50,000 credit and $25,000 credit. That doesn't balance, right? You have $25,000 more on the debit side. So that would need credited in order to make the entry balance. Usually books do this through an Income Summary account that makes it easier to see, but takes an extra step.
Probably the easiest way, given the method they're using, is to just do all your revenues and expenses, add up the two sides and see where there's a missing number. You have $100,000 total credit and $75,000 total debit. So you're "missing" $25,000 on the credit side. So put that credit into Retained Earnings.
If you want the explanation of why -- revenues less expenses equal net income. So that $25,000 is the net income. Your revenue is on the debit side in the closing entry, and it's bigger, so revenues are bigger than expenses. Creating a net income of $25,000. And net income increases retained earnings. To increase retained earnings, you credit.