Quartz is found in a variety of geological environments, including igneous, metamorphic, and sedimentary rocks. It is a major component of granite, quartzite, and sandstone. Additionally, quartz can also be found in hydrothermal veins and as a component of pegmatites.