On a sold-out product, the shopper sees Get an email when it's back in stock under the stock line. Guests type their email; signed-in customers just tap Notify me (their account email is used).
For products with variants, they sign up for the size or colour they have selected.
They see a confirmation straight away.
When the product is back in stock, they get one email with the product name and a link to it, in your store's email design.
They are emailed once. If it sells out again, they must sign up again.
Limits
Customers can't see a list of their alerts in their account.
The email has no "stop this alert" link. A shopper who changes their mind simply ignores it — they are only emailed once anyway.