I've never done it myself, but I read about it, its traditionally done this way:
- You need a tripod (which is why I never did it myself, I rarely carry a tripod)
- You need low light and bright point sources of light
- You need a lens that has 9 or 7 blades. Preferably straight blades, but its enough if they are rounded for lower apertures and only turn straight at f/11 upwards.
- 9 blades give 18 point stars. 7 blades give 14 point stars. Unfortunately, more than 9 blades will make the effect vanish because the aperture will be too close to a round circle.
- The effect appears with even numbers of blades as well, but even numbers of blades will only give the same number of points as there are blades.
- You need to stop that lens down to like f/16, which combined with the low light means tripods are required
I guess the filter that has been mentioned is a much more easy option, especially since you can give your stars as many points as you want. You could even go for an odd number of points.