Step by step
Turn on expiry for the product
Then every receipt and opening stock of it asks for a batch number and an expiry date.
First to expire, first out
Sales take the batch that expires first. Expired batches are never sold; write them off with an "Expired" adjustment.
Get warned
Reports › Near expiry and expired lists what expires within 30, 60 or 90 days (change the windows in Settings › Sales rules). It is in the alerts and the Telegram summary too.