Short answer first, then the reasoning. Do it in two steps and it stops being confusing. First concentration: 10mg into 2ml is 5mg/ml. Then volume: a 0.5mg dose is 0.5 ÷ 5 = 0.1ml. Then units, and this is where people go wrong — a U-100 syringe is graduated in hundredths of a millilitre, so 0.1ml is 10 units. The word "units" has nothing to do with milligrams; it is a volume marking that exists because insulin happens to come at 100 units per ml.
Ask again with the specifics and you will get a better answer than this one.