It's the same process as for cars, just bikes have smaller lenses. Varying grades of wet/dry, followed by the same but polish. A deep scratch depending on it's depth may be impossible to polish out, as the lens is only so thick. It's also in most cases easier to remove the headlight unit from the bike/faring etc.
The only issue with this is motorcycle headlight lense come with an anti-scratch coating, this method will remove that. So evertytime you clean your bike it would put micro/small scratches back.
[/q]
@Dave48, you could use the above kit as Gnasher suggested but then instead of using the final wipe, do a proper lacquer clear coat from a spray can just take your time, follow the instructions on the tin,spray in lots of thin layers (you do not want any runs) and after final coat give the lacquer several days to cure fully hard.then get 2000/3000 grit so to flat it and remove any imperfectionsthen buff it with polishing compound to a gloss finish.@Gnasher I assume my suggestion above should last for years if done right?