How to Make Your Webpage Secure from Attacks

What do I have to put in place to ensure that my website is protected from external attacks by hackers, viruses, worms or Trojan horses? Which security features are very necessary for maximum protection from attacks? Can I design my own system or it is wise to leave it to the expert to take care of it?
