I had a go photographing myself with stars. The trick is to have a long exposure for the stars (in this case, ISO 3200, 15 seconds, f4) plus a flash photo for me (or anything else you’d like in the foreground.) I set the flash to half power.
If the person moves before the 20 seconds have finished, you might get stars and/or the horizon showing through.
I want to get really good at this.