Can Unpaid Rent Be Deducted From the Deposit?

Can unpaid rent be deducted from the deposit?

Note: LandlordAid, our AI assistant, answered this question. We have left the response close to the original, except for grammar and minor formatting changes. You can find more details here.