Step 1: Keep your browser up-to-date
Nowadays – at least by default, your browser likely installs updates automatically, and it will notify you when you need to restart the application. If for some reason you have disabled automatic updates, please enable it.
While you’re at it, if you’ve disabled features such as Chrome’s Safe Browsing setting, enable it.
For everyone else that hasn’t disabled this stuff, just make sure you don’t need to restart your browser to install some updates, and you’ll be good.