Halophiles and thermophiles are two of the three groups of Archaea. Halophiles live in environments with plenty of salt concentration and thermophiles live in geothermal areas where there is plenty of heat.
What exactly is their role in their extreme environment?
An example is methanogens live in wetlands and intestinal tracts of herbivores. Their main role in their environment is to remove excess hydrogen and fermentation products that have been produced by other forms of anaerobic respiration.