We've tried at the local bike coop, and nothing really works. A shim or boot on the inside helps but putting anything on the outside won't last.
Even using rubber cement and a puncture plug (like a car tyre) doesn't stick very well because bike tyres are not very thick, so there is insufficient "meat" for the plug to bond to. If you make the plug longer, it becomes a spike aimed at your tube and pressing in every rotation.
Prevention is the only option, and that's not always a viable answer.
Narrower tyres could help too, you're sweeping a thinner ribbon of roadway with your rubber.
Someone else might like to comment on tyre sweeper wires, but I've never used them and to my mind the damage is already done once your wheel has ridden over the sharp thing once.
Later: I have successfully extended the life of a holed-tyre by adding a boot on the inside of the tyre using one of those horrendously thick patches that we all seem to have but dislike using on tubes.
The trick was to invert the tyre, and buff the inside very well with an abrasive like a file intended for buffing the tube. Otherwise I treated it like a normal puncture repair.
The only ordering change was to return the tyre to its conventional outside-outness after applying vulcanising fluid and while it set-up, and before applying the patch. I also used the biggest thickest patch I had.
I do not recall if I attempted to add a second patch diametrically opposite the wheel to offset the weight, might be a wise plan.
If your hole is under 2mm in diameter, give it a go. Your only loss is a patch and some fluid, and your time. If the hole is bigger than 2mm then sorry, its new-tyre time.