At first I was using a punch set to stamp my Initials and a significant year For my serial numbers XX1943 after a while I just used a Dremel tool It doesn’t look as good but it is less nerve racking. With a stamp you get one strike If you screw up you can’t fix it, with a Dremel it is much easier to Not make mistakes.Federal law requires only licensees to put serial numbers on firearms they manufacture, and they have strict standards about marking and record keeping.
If you want to do it on your own, you can do anything you want, from nothing or freehand with a sharpie, to laser etched or CNC milled.