Masking footage over 3d objects in Blender 2.8+? I don't get how to make a mask and use it properly. What I'd like know exactly is how to make a mask of a certain area of the footage, keep it tracked to the footage and make the mask layered in front of any 3d mesh.

Q: How do I create a proper mask to place any 3d object behind an element of my footage?
Load the background image in the image editor or the movie clip editor.

Set the editor in mask mode

On the image, click while pressing the Ctrl key and draw a mask for the area you want to use as foreground.

Then in the compositor use that mask to combine the foreground and background elements.