Majority rules
Recently, an answer to the question was further articulated in a book by science historian Naomi Oreskes. Oreskes acknowledges the importance Popper placed on the role of attempting to refute a theory, but also emphasises the social and consensual element of scientific practice.
For Oreskes, we have reason to trust science because, or to the extent that, there is a consensus among the (relevant) scientific community that a particular claim is true – wherein that same scientific community has done their best to disprove it, and failed.
Here is a brief sketch of what a scientific idea typically goes through before a consensus emerges it is correct.
A scientist might give a paper on some idea to colleagues, who then discuss it. One aim of this discussion will be to find something wrong with it. If the paper passes the test, the scientist might write a peer-reviewed paper on the same idea. If the referees think it has sufficient merit, it will be published.
Others may then subject the idea to experimental tests. If it passes a sufficient number of these, a consensus may emerge it is correct.
A good example of a theory undergoing this transition is the theory of global warming and human impact on it. It had been suggested as early as 1896 that increasing levels of carbon dioxide in Earth’s atmosphere might lead to global warming.
In the early 20th century, another theory emerged that not only was this happening, but carbon dioxide released from human activities (namely fossil fuel burning) could accelerate global warming. It gained some support at the time, but most scientists remained unconvinced.
However, throughout the second half of the 20th century and what has so far passed of the 21st, the theory of human-caused climate change has so successfully passed ongoing testing that one recent meta-study found more than 99% of the relevant scientific community accept its reality. It started off perhaps as a mere hypothesis, successfully passed testing for more than a hundred years, and has now gained near-universal acceptance.
The bottom line
This does not necessarily mean we ought to uncritically accept everything scientists say. There is of course a difference between a single isolated scientist or small group saying something, and there being a consensus within the scientific community that something is true.
And, of course, for a variety of reasons – some practical, some financial, some otherwise – scientists may not have done their best to refute some idea. And even if scientists have repeatedly tried, but failed, to refute a given theory, the history of science suggests at some point in the future it may still turn out to be false when new evidence comes to light.
So when should we trust science? The view that seems to emerge from Popper, Oreskes and other writers in the field is we have good, but fallible, reason to trust what scientists say when, despite their own best efforts to disprove an idea, there remains a consensus that it is true.