USBasp programmer first firmware
You could program it before you solder it in, using a ZIF socket programmer. If making many of the board, then your supplier can program them for you. ZIF socket programmers are available for QFN and MFN packages.

Alternatively you can provide an ISP header on the PCB, or equivalent pads for pogo-pins to program in circuit. Using just pads for pins takes up much less board space.

If it's a one-off prototype and you have already soldered it onto the board, you can also solder bodge wires from the pins of the MCU to a loose ISP header.