This trips up a lot of newcomers, so plan it before you travel. In many countries pharmacists are surprisingly flexible and will sell medications over the counter that require prescriptions back home, while in others, especially in Western Europe, Japan and the Gulf, rules are strict and a local prescription is mandatory for anything beyond basics. Your home prescription is usually not directly honored; at best it helps a local doctor quickly write you an equivalent one, so a short clinic visit is the standard route for refills.
A few important cautions. Brand names change across borders, so know your medication's generic name. Some drugs that are routine at home, certain painkillers, ADHD medications, sleeping tablets and codeine products, are controlled or outright banned in some countries, and carrying them without documentation can cause real legal trouble; check the embassy website of your destination before flying.
Best practice from long-time expats: carry enough supply for your initial period plus a buffer, keep medicines in original packaging with the pharmacy label, and bring a doctor's letter listing your conditions and generic drug names. Counterfeits exist in some markets, so buy from established pharmacies rather than street stalls.