There are many things that a defense needs to be good at keeping the puck out of the net. The biggest thing is that they need a solid offense to support them. One of the first keys to playing good defense is keeping the puck out of the defensive zone. However, there are many other things that have to happen to keep the puck out of the net.
Do not pretend that you are going to keep the puck in the other team's zone for the entire game. You will have to play some time in your zone, and how many goals they score depends on
1) How well the puck is kept to the outside
2) How many shots get through the defense
3) How deep the puck is in the zone
4) How many options the other team has
1) Keeping the Puck to the Outside
As a rule you do not want the puck in the middle of your zone. You want to keep the puck to the outside. If you do this you will give the other team a harder time scoring goals.
2) Shots getting through the Defense
The more shots that get through the defense the more shots the goalie will have to face. Understand that the only way to block shots without screening your goalie is to force the other team to pass. Put pressure on them and wait for them to make a mistake.
3) Keeping the Puck Towards the Blue Line
You always want to keep the puck towards the blue line. Do not let the other team control the puck in the corner. This is an easy set up to a pass in front of the net and a goal.
4) Limit the Options
You have to force the other team to make decisions that it does not want to make. Keep up the pressure by limiting the options that they have. More importantly do not let them buy time.