Web security!

Hello everyone, after finished to code my website, it is ready to be published but I worry about malicious attacks from hackers, how can I secure my web to be protected from all attacks ?

This is impossible. Even google can be hacked but you can make it harder by encrypting it. You can use GH pages that are automatically encrypted. To turn it off WITCH YOU NEVER SHOULD you would need to be using a custom domain. And if you aren’t handling sensitive data that are saved on the server (user data and similar things) there isn’t as much of a reason to have heavy encryption.

It really depends on what technologies and stack your website is built from and what security measures you already have implemented. But you should deploy it using https. Usually there are robust libraries to help with securing the webserver (such as passport.js for Node.js/Express). There are also authentication providers such as Auth0, Okta or Firebase Auth which can simplify the task. You would also need to handle database security, data validation, storage of credentials and other things. You should take security seriously but how seriously will depend on the nature of the website.