There are several ways to deal with this.
One way is to remove the sight and use a slightly dulled center punch to raise a row of punch marks. These punch marks will raise slight craters of metal around the marks and this will tighten the fit.
Some pointers: Make sure the punch is slightly dulled or rounded. The idea is to raise metal around the punch marks.... not just make holes in the metal like a sharp punch will.
Second, if at all possible, you make the row of punch marks on the SIGHT, not the slide. You always work on the part that's easiest and cheapest to replace if something goes wrong.
Another good method is to degrease the sight and slide dove tail and use Loctite. If you can remove the sight, use a solvent to degrease both the sight and slide dovetail.
If you can't get the sight out, apply a solvent to the area and quickly blow it under and through the dovetail by sealing your mouth around the slide (disassembled from the gun of course) and blowing to force the solvent through. If the sight has white dots or luminous inserts, use a solvent that won't attack them. Alcohol works for this.
After degreasing, dry the area throughly. If the sight was still on the slide, use a hair dryer to warm the metal slightly to dry. WARM, not HOT.
Next, use your choice of Loctite Red or Blue. Red is permanent, Blue is semi-permanent. There's also a Loctite made very thin so it will wick into joints on it's own. If the sight is still on the slide and you're using Red or Blue, use the same blowing technique to force the Loctite into the dovetail. (Don't swallow, rinse your mouth out).
Wipe off the excess and allow 24 hours to fully cure.