High-pressure high-temperature (HPHT) studies are crucial for understanding the mineralogy, petrology, dynamics, and chemistry of materials inside the Earth, celestial bodies, and extrasolar planets. Exposed to the HPHT conditions, solid state matter might not only undergo structural transformations but also reveal changes in physical properties such as optics, electronic states, magnetism, thermal- and electrical conductivity, etc. Although the mineral physics studies remain the mainstream of high-pressure research, recent methodological developments have driven the focus into a new area - the synthesis and characterization of novel compounds with exotic crystal chemistry and physical properties. The plethora of discovered phases validates the importance of pursuing this new research path. Laser-heated diamond anvil cells (LHDACs), enabling to cover the widest P,T-range, is the most powerful tool to reach the HPHT conditions required for the synthesis of novel . The in situ high-pressure single-crystal X-ray diffraction (SCXRD) is an ideal instrument, providing direct and unequivocal information on both the atomic arrangement and chemical composition of crystalline matter. Combination of LHDAC technique with SCXRD and pushing up pressure-temperature conditions achievable in structural studies extend our knowledge of materials behavior at extremes. This thesis summarizes methodological developments aiming at improving both the LHDAC performance and the experimental strategies of the SCXRD data collection at multimegabar pressures. It also presents the results of numerous experiments performed on different chemical systems relevant for geo- and material sciences that led to a number of original and important findings. The first part of the presented research is dedicated to the testing of the secondary stage anvils shaped with the focused ion beam (FIB) from the single-crystal diamond plate. We evaluated the efficiency of anvils of different designs for pressure multiplication in different modes of operations: as a single indenter or as a pair of anvils in the double-stage DAC (dsDAC) assembly. The maximum of achievable pressures in DACs with a single indenter appeared to be independent on the size and shape of the secondary anvil. However, the anvils of modified toroidal design enabled a gain in the sample volume that significantly improved the quality of XRD data. In the scope of methodological development, we installed and commissioned a novel sub-micron focusing setup for high-pressure X-ray crystallography at the extreme condition beamline P02.2 at PETRA III, DESY (Hamburg, Germany). We have demonstrated the capability of the new setup to successfully perform SCXRD studies at ultra-high pressures by test runs conducted on micron-sized calibration samples, followed by structural studies of Fe-bearing silicate perovskite (Mg0.91(2)Fe0.09(2))SiO3, and novel orthorhombic high-pressure polymorph of Fe3O4 (i.e. γ-Fe3O4 ) at pressures above 150 GPa. The experiments conducted on magnetite at pressures up to ~80 GPa and temperatures up to ~5000 K revealed the two hitherto unknown Fe3O4 polymorphs –γ-Fe3O4 with the orthorhombic Yb3S4-type structure and δ-Fe3O4 with the modified Th3P4-type structure. We also found that Fe3O4, pressurized above ~75 GPa and heated above ~2000 K, becomes chemically unstable and undergoes a series of self-redox or decomposition reactions. Among the chemical products of these processes, we found hcp-Fe and two exotic iron oxides - Fe5O7 and Fe25O32, both with unusual compositions and crystal structures. A significant part of the thesis is dedicated to studies of crystal structures of novel metal carbides synthesized in LHDACs. In particular, hitherto unknown rhenium-carbon (Re-C) compounds formed due to direct chemical reactions of the diamond anvils with the rhenium gasket at pressures of about 200 GPa after pulsed laser-heating. Using the nano-focused synchrotron X-ray beam, we obtained SCXRD data and established crystal structures and chemical compositions of four phases: Re2C, ReC2, ReC, ReC0.2 - uncovering the unexpectedly rich chemistry of the Re-C system at multimegabar pressures. The crystal structures of Ca-C compounds, Immm-CaC2 (HP-CaC2) and Ca3C7, revealed complex poly-anionic carbon entities - deprotonated polyacene-like and para-poly(indenoindene)-like nanoribbons, respectively. The synthesis of these phases was realized in LHDACs in the pressure range of 40-150 GPa. Based on experimental XRD data and theoretical calculations we analysed the nature of chemical bonding and established the compressional behaviour of synthesized compounds. Finally, the methodology of the synthesis and study of novel compounds at terapascal pressure range in a laser-heated dsDACs was exemplified on the Re-N system. The full chemical and structural characterizations of Re7N3 and ReN0.2 solids were realized in situ by means of SCXRD at Material Science Beamline ID11 at ESRF (Grenoble, France), unambiguously proving the possibility to extend high-pressure crystallography to the terapascal regime within the multi-grain samples.