Cmd+shift+5, then in the bottom icons, click the icon for recording the entire screen or the selected part of the screen. The .mov it makes is a fine format, but if it won’t work for your project, you can convert it to mp4 with iMovie (or a bunch of other options.)
One-time reasonable cost, great app is CleanShot X.
I didn’t know it even did video until I was looking for the same thing - something better than the brute-force QuickTime but not a full editing suite like the pricey Screenflow.
The video features are well designed and robust - not a throwaway afterthought and have been perfect my uses.