Galaxy clusters form an integral part of the large-scale structure of the Universe. Therefore a census of clusters can provide quite precise insight into the cosmic large-scale structure and can be used to test cosmological models. X-ray observations provide us with the most detailed information on galaxy cluster structure and on various physical parameters of clusters and they offer a very good means to detect galaxy clusters. Based on X-ray surveys of galaxy clusters and detailed follow-up observations I give a review on what we have learned on the structure of galaxy clusters and its statistics. I also show how the mass or X-ray luminosity function of clusters and their spatial distribution can be used to assess the large-scale structure of the dark matter distribution and how this assessment can be used to test cosmological models. Results from the cluster population detected in the ROSAT All-Sky Survey provide very good constraints on the matter density and the normalization of the power spectrum of the dark matter density fluctuations on large scales. The upcoming eROSITA mission will greatly improve the capabilities to use a large sample of up to 100 000 X-ray detected galaxy clusters for these test of cosmological models.