What you need
1. Measure the shaft, not the old knob
The old knob is the broken part — measure the shaft it sits on. You need the shaft diameter, the flat-to-flat distance if it is a D-shaft, and how deep the shaft goes.
2. Leave clearance
A D-shaft needs 0.2 mm clearance on the flat and 0.15 mm on the diameter. Print a 10 mm tall test ring first; it takes four minutes and saves a whole knob.
3. Build the boss for the insert
An M4 heat-set insert needs a 5.6 mm hole, 8 mm deep, with at least 2.5 mm of material around it. Make the boss a hexagon or add ribs — a round boss on a thin knob will split when the insert goes in.
4. Print it hot and slow
PETG at 245 °C, 0.16 mm layers, four perimeters, 40% infill. Strength comes from walls, not infill.
5. Set the insert
Heat the iron to 220 °C, hold the insert with tweezers, and press straight down until the flange meets the boss. Do not twist. Let it cool for five minutes before you test-fit the shaft.