X-ray crystallography is used to determine the atomic structure of crystals like proteins and nucleic acids. It works by firing X-rays at a crystal sample and analyzing the diffraction pattern. This pattern is unique to each molecule and can reveal its 3D structure. To perform X-ray crystallography, the molecule of interest must first be crystallized to fix it in place. The diffracted X-ray pattern is detected and the intensity and angles are used to reconstruct the electron density and infer the molecular structure. This structure can then be deposited in databases like the Protein Data Bank for comparison with other known structures.