How to prevent a DDos attack?

How to prevent a DDos attack?

This is an overload on the server hosting sites or services, causing access to be denied to those trying to access it at the time of the attack. Malicious hackers use botnets to make the service crash or go offline.