In the offensive zone, defensemen provide backside support to the forwards who are working down low to create scoring chances. The D-men stand guard near the blue line where they make every effort to keep the puck inside the attack zone. Teams that move the puck well will use their point-men to spread out the opposition and generate shots from the perimeter through traffic. When the puck is shot from the point, it's usually best to keep it low and hard so the forwards can screen the goaltender and pickup the rebounds more easily.
When the puck is turned over to the other team, the defensemen must make a judgment call as to whether or not they should hold their position at the blue line and try to prevent the opposition from breaking out or drop back to take a safer defensive position. Stepping up to prevent the opposition from breaking out is called pinching. Great defensemen know when it's appropriate to pinch and when it's better to drop back and allow the opposition to carry the puck out so they don't get burned at the blue line.
Timing is everything – watch some of the premier defensemen in the NHL and you'll notice that sometimes they pinch aggressively while other times they'll back off to play the gap on the attacking forward. As a rule of thumb, unless you're 90% sure that you'll come out with the puck on a pinch, it's safer to drop back into a defensive posture. When the puck is on your defensive partner's half of the ice, swing to the middle and provide support on the strong side. This will help you close the gap on the opposition as they try to clear the puck and will give your partner another passing option.
The key to playing well as a defenseman in the offensive zone is to keep it as simple as possible. The blue lines are the most dangerous areas on the ice. Turnovers at the blue lines often lead to odd-man rushes going the other direction so don't get too fancy when you're playing the puck at the blue line. Get it deep, move it to someone down low, put it on net or eat it; As soon as you start trying to make moves at the point you'll quickly find yourself on the wrong side of the puck, frantically backchecking.