Any user who visits your website for the first time, he will be asked to grant permission to show him a notification. User can accept or decline. It will only happen once so next time when he will visit your website you can show him notification right away.
We are going to cover pure basics of Notification API. The real power comes when you can send such Notifications also known as web push notifications through your own server or third party service. Such thing is out of scope of this tutorial. You can google to learn more about web push notifications.