You can notice it because when someone is visiting one of these sites that embeds cryptocurrency mining code it maxes out the visitor’s CPU.
You can make a test by visiting the Cryptojacking test site to see if you are vulnerable.
How to block cryptojacking?
Some developers have realized browser extensions that can block these scripts:
Users that already have an Ad blocker can add the list from adblock-nocoin-list Github project to prevent mining scripts.