Methanogens thrive in environments where oxygen is absent and organic matter is undergoing decomposition. Examples include the digestive tracts of ruminants (like cattle rumen), anaerobic sludge digesters in wastewater treatment, and sediments in swamps and marshes.