Setting up PoseNet with ml5js, or Pose Landmark Detection with Google MediaPipe is hard. I've started a set of sketches to make this much easier.
ml5js is much easier to set up than MediaPipe, yet coders neet to load the api, check to see if the poses array contains a pose, or learn about loops. EasyPoseNet is a starter sketch using the p5js editor. The sketch is set up to include a file called easyPoseNet.js that does all the heavy lifting for you. All you need to do is call the command startPoseNet() and you will have access to a person object with all the body parts to use in your code. Have a look here, instructions are in the comments:
This sketch does the same as above, but for MediaPipe Handpose instead: