Instructions
Apple's default video player in macOS has a picture-in-picture (PiP) feature that allows you to play video in a floating window. This lets you can keep one eye on what you're watching and the other on what you're doing.
Apps and websites that use Apple's default video player
On the video player, click the PiP button in the bottom right corner.
YouTube and other sites that use their own video player
Right-click on the video and click Enter Picture-in-Picture.
TIP: If you don't see the option "Enter Picture-in-Picture", it may be because a non-Apple pop-up menu has appeared. If so, right-click on the video again outside of the third-party pop-up window.
Outcome
Your video will be in PiP mode.