This is possible because each nitrogenous base in one strand pairs only with one other base in the complementary strand as follows:
Adenine (A) always pairs with Thymine (T)
Guanine (G) always pairs with Cytosine (C)
So, if one looks at a single strand of DNA, one can reconstruct the sequence of the complementary strand from the original strand.