How do Nitroglycerine and Nitrates work?

How do Nitroglycerine and Nitrates work?