Write-offs and recoveries
When an account is judged uncollectible, it is written off against the allowance in that period: Dr Allowance for credit losses / Cr Accounts receivable. The entry changes neither net receivables nor expense, because the expense was recognized when the allowance was built. The direct write-off method, which records the expense only when an account is written off, isn't GAAP when credit losses are material.
If a customer whose account was written off later pays, the recovery is recorded when the cash arrives. The usual entries reinstate the account and then record the collection: Dr Accounts receivable / Cr Allowance for credit losses, then Dr Cash / Cr Accounts receivable. Since ASU 2019-04, the allowance may also reflect recoveries the company expects on amounts already written off, but no more than the amounts written off or expected to be written off.
The allowance rollforward ties these together: beginning allowance + credit loss expense + recoveries - write-offs = ending allowance. Given the required ending balance and the other amounts, solve for the expense.