It's a 2022 expense. The second you handed the contractor the check, or the second you dropped it in the mailbox, that money was no longer under your control. For the person you paid, the fact they received it in 2023 doesn't matter. They have what's referred to as "constructive receipt" on whatever date is on the check.