hyphens are used to join two words or parts of words together while avoiding confusion or ambiguity.
Dashes can be used to add parenthetical statements or comments in much the same way as you would use brackets. In formal writing you should use the bracket rather than the dash as a dash is considered less formal. Dashes can be used to create emphasis in a sentence.