If your pen is working on your tablet, but it is moving the pointer on the wrong display it is an easy problem to fix.
Overall: You need to go to your tablet driver and change which display the tablet's active area is mapped to.
For Wacom:
In the Wacom Tablet Properties app, it will be under the Mapping tab, the Calibration tab
For Huion:
In the HuionTablet app, it will be under the a tab called Working Area
For XP-Pen:
In the XP-Pen Pentablet app, it will be under the Screen tab