Securing WordPress Against Hackers and DDoS Attacks

Hello! How do you password protect your directory by setting up .htaccess password protection?