A method for extracting substances from a fecal sample using mass spectrometry or nuclear magnetic resonance spectrometry, and metagenomic analysis using a next-generation sequencer. The method includes step A: a step of suspending the fecal sample in any one of the following solvents (a) to (g) to obtain a suspension: (a) a solvent comprising an aqueous solvent and a hydrophilic organic solvent (b) a solvent comprising an aqueous solvent and a hydrophobic organic solvent (c) a solvent comprising an aqueous solvent, a hydrophilic organic solvent and a hydrophobic organic solvent (d) a solvent comprising a hydrophilic organic solvent (e) a solvent comprising a hydrophobic organic solvent (f) a solvent comprising a hydrophilic organic solvent and a hydrophobic organic solvent and (g) a solvent consisting of water step B: a step of separating a liquid layer comprising the solvent from the suspension and step C: a step of removing proteins from the liquid layer and then obtaining the one or more substances.