Here you can see how the two strands of DNA are bound together by proper pairing of the bases in its core.
Use the "Change Base" buttons at the left and right to change the corresponding base.
Adenine (A) and Thymine (T) are shaped so that they naturally fit together. More importantly, this fit places atoms which are slightly negative (oxygen and nitrogen) adjacent to slightly positive hydrogen atoms. The resulting charge attraction forms hydrogen bonds (shown in yellow) which hold the base pairs (and DNA strands) together.
Similar fit and bonding are achieved when Cytosine (C) is paired with Guanine (G).
But fit and bonding do not occur when A or T are paired with G or C.