A lot of pens are water-based which makes getting ink out very easy.
Blot as much of the undried ink out as you can. Use a water-based stain remover (check the instructions that it can be used with the garment you are working on) to pre-treat the stain and blot again. This way you can get a good proportion of the ink out before you try and wash the garment.
Wash with normal detergent and at normal temperature on its own. As soon as the wash has finished, check the stain and if necessary pre-treat again and put on another wash cycle. Don’t let the garment dry with the stain still visible.
Further tips, including on how to remove ink that is not water-based can be found here.