どうして + [sentence]? どうして + [verb (plain)] + の? どうして + [verb (plain)] + んですか どうして + [noun] / [na-adj] + なの?
どうして means "why". It goes at the front of the question, and the question usually ends in の among friends or んですか in polite speech, since you are asking for an explanation.
The answer gives the reason and ends in から.
All three mean "why". なぜ is the formal one, for writing and speeches. なんで is the casual one, among friends. どうして sits between them and works in polite and plain speech alike.
To ask how something is done, use どうやって. どうして asks for a reason.