Automate email sending before expiration date

I want to be able to have the system automatically send an email to users 2 months before the expiration of a product, alerting them of its expiration. How is it possible to have the system do the date calculation and send the email without human intervention?

Use cron job if you want to do that automatically without human intervention.