See the articles Set up and use iCloud Photos - Apple Support
Download iCloud photos and videos - Apple Support
How to download photos and videos from the Photos app
If you want to download a full-size copy of your photos and videos from the Photos app to your iPhone, iPad or iPod touch with iOS 10.3 or later or iPadOS, or your Mac with OS X Yosemite 10.10.3 or later, follow these steps.
On your iPhone, iPad, or iPod touch
- Go to Settings > [your name].
- Tap iCloud, then tap Photos.
- Select Download and Keep Originals.
On your Mac
- Open the Photos app.
- Choose Photos > Preferences.
- Select iCloud, then click Download Originals to this Mac.