'Over-the-counter', sometimes called OTC medicines, can be just as effective as prescription-only and they work for some people just as well as prescription drugs. 'General sales' medicines can be sold in supermarkets without the supervision of a pharmacist. These are often sold at lower doses than prescription medication and are usually for less serious conditions, like a cold, that you may not need to see a doctor for.
No medication is totally risk-free. However, in the UK, all medicines used to treat people must be licensed by the Medicines and Healthcare products Regulatory Agency (MHRA) and adhere to strict safety standards. You should still always read instructions carefully as OTC medicines can have side effects and interactions, just like prescription drugs.