Link that forces virus on to PC

I visited a link which opened few windows made entire screen full with a virus on your pc please call etc…(im sure you all know and seen it before)

Is there a way to prevent such activity, build a block for such websites etc…

If needed, let me know i can paste link for reference