Read Apple documentation article Setting Up a Capture Session, which covers configuring input devices, output media, preview views, and applying basic settings before capturing photos or videos.

Explored Apple sample code AVCam: Building a camera app, a well-written SwiftUI app for capturing photos and videos. I think I’ll borrow some ideas from it.