How do atoms form a new substance?

Aby gaining electrons from each other
Bby sharing electrons with each other
Cby losing neutrons to each other
Dby losing electrons