Scientists cannot directly observe another being's subjective experience, so they rely on indirect evidence: behavior (such as pain-avoidance, learning, and flexible choices), brain structures and activity patterns, and comparisons with human brains. Researchers have built checklists based on theories like global workspace and higher-order thought, and they apply them across species, with more confidence for mammals and birds than for insects or other animals with very different nervous systems.
The hard part is that no test yet proves whether an animal feels anything at all, because each method assumes some link between a measurable signal and experience. Many scientists think the best current approach is to weigh converging evidence and make cautious judgments about which animals are likely conscious, rather than expecting a single decisive measurement.