In the U.S., the government's Food and Drug Administration (FDA) must approve any drug before it can be sold. This is true whether it's a prescription or an over-the-counter drug. The FDA evaluates the safety of a drug by looking at
The FDA also monitors a drug's safety after approval.
For you, drug safety means buying online from only legitimate pharmacies and taking your medicines correctly.
References and abstracts from MEDLINE/PubMed (National Library of Medicine)