Suppose I have a crystal of which I like to determine the distance $d$ between the lattice planes. We can use a Bragg diffraction experiment to do so by making a plane wave of X-ray radiation with wavelength $\lambda$ incident on our crystal. It is easily derived that
$$ n\lambda = 2d\sin(\theta) $$
should hold, where $\theta$ is the angle between the crystal plane and incident radiation. If we know $\lambda$ and $\theta$, we can find $d$.
Since I do not know what the inside of the crystal looks like, I do not know how the crystal plane is oriented, thus I do not know what $\theta$ is.
Question How does an experimenter know $\theta$?