The classification of bacteria as "good" or "bad" for humans is based on extensive scientific investigations using molecular biology techniques, in-vitro and in-vivo analyses, as well as clinical studies.
In the context of the human microbiome, "good" bacteria are defined as those that live in a symbiotic relationship with the human body, meaning that both sides benefit from one another without harming the human host.
For example, these "good" bacteria can help prevent the growth and proliferation of pathogenic (harmful) microorganisms by competing for nutrients and colonization sites.