Dreadnoughts are gravely wounded space marines that have been interred into mechanised machines that allow them to fight on.
Dreadnoughts, like every Space Marine unit, can be upgraded to fill a specific role. A default Dreadnought is melee oriented but it can be upgraded to have an assault cannon, a multi-melta, a twin linked lascannon or an inferno cannon. An assault cannon is effective against infantry due to it's high rate of fire. Multi meltas and twin linked lascannons are effective against vehicles. And the inferno cannon is effective against structures and morale.
Due to being vehicles, dreadnoughts are vulnerable to anti vehicle weapons so it is important to support them in battle.