Defense is a lot of fun... no position I'd rather play, but alot of what you do depends on what your teammates are doing. A D man's success has alot to do with how much help they get from thier forwards... having said that:
Always make sure you are between the puck carrier and the net. Let your goalie see the shot and DO NOT try to deflect it with your stick unless you are right up against the shooters stick.
Gap control is essential. You need a few feet between you and the rushing opposition in the neutral zone, but you need to gradually close that gap to a stick's length at your blue line. This will allow you to force the issue at the blue. On an even man rush, this is the place to attack to puck carrier... you will most likely cause a turnover, an offside or a dump in. IF the puckhandler button hooks, hopefully your winger will be backchecking to pressure him. To attack, look at his chest in between his shoulderblades, not at his feet or puck, then slow down and seperate him from the puck. If you can get him moving laterally, it's a good opportunity to poke the puck off his stick. If it's an odd man rush, you still need to close the gap, but obviously you won't be aggressive at the blue. Stay in the middle, cheating slightly to the shooter. Your main job is to prevent the pass. if you get below the hash marks, you may want to lay flat on the ice to assure there won't be a deadly cross crease pass. This also applies to a 3 on 2 when you're on the strong side (your d partner isolates 1 leaving you with a 2 on 1)
When your D partner has the puck in your zone, your main job is to be open for a pass or reverse. If your partner comes over to your side of the ice with the puck switch sides on the ice so he can give it to you if he gets pressured. If he has the puck in the corner, stand beside the net on your side. This will allow you to quickly move behins the net to give him an 'out', or get to the front of the net to protect it in case of a turnover. If he's skating up the ice in your zone... be on the other side towards the middle of the ice and slightly behind him to cover up in case of a turnover. If he's backing up with the puck facing the play... be on the other side slightly ahead of him so he can 'switch' the puck to you and you can break out.
There's so much more to tell you, but these are some of the things I expect my partner to do to make the position easier. Having a good partner makes a world of difference. Having the 'out' when your forwards abandon you is big.