It is harder to build X-ray mirrors for X-rays above an energy of ~10 keV, so the HXD use the method of “collimation.” Imagine observing a star near bright city lights by looking through a cardboard tube: the tube is a collimator, a device that shields your eyes from light coming from directions other than the star you are pointing at.
The HXD is a non-imaging instrument, meaning that it is sensitive to the different energies of light that come into the detector, but is not sensitive to their positions. Astronomers can make spectra and light curves from the HXD data, but not images.
In technical terms, the HXD has 16 identical “Well-type Phoswich Counter” units. The detector itself is made up of a material called GSO. It glows (mostly in visible light) when it is hit with X-rays. Scientists call GSO and similar materials a “scintillator.” The collimator is made of a different type of scintillator crystal (BGO), and is shaped like a well. BGO does not actually stop extraneous X-rays, but allows scientists to tell which X-rays are coming from the direction they're looking at and which X-rays are coming in from the side of the detector. The on-board computer will discard all the X-rays coming from the side. This clever design allows very sensitive observations for X-rays with energies up to 700 keV!
The Hard X-ray Detector (HXD) is designed to keep out X-rays coming from directions other than where it is pointing.