For many medicines, you really can't separate efficacy from safety. As an extreme case, take for example cancer drugs. They typically have high side effects and every year, a certain proportion of the people taking them, die from the side effects. That is an acceptable risk because there is evidence that they are efficacious in treating cancer. If they are not efficacious, that is a completely unacceptable risk.
Less extreme are antibiotics which can also have bad side effects, but are useful drugs because they actually kill bacteria. If they did not, the side effects would be unacceptable.