To apply a retainer or an advanced payment, you need to go to the Payments screen, set the payment method to Use Retainer, then enter everything else just as you would for any regular payment. You can see the available retainer also on this screen. Check the Core Help for details.