Before you start
Make sure the iPhone has room for full-size originals: with Optimize iPhone Storage on, the phone holds smaller versions (Apple). Apple's advice is to download originals first and check you have enough space (Apple).
Step by step
- On the iPhone, go to Settings > your name > iCloud > Photos.
- Tap iPhone Storage and choose Download and Keep Originals. Wait until the download finishes.
- Turn off Sync this iPhone and choose Download Photos & Videos.
- On a computer, open iCloud.com > Photos, select what to delete, and delete it (Apple).
- Empty Recently Deleted on iCloud.com if you want the space back now.
Deleting everything from iCloud
For the whole library, Apple's route is Settings > your name > iCloud > Storage > iCloud Photos > Turn Off and Delete Photos. Photos are deleted from iCloud 30 days after you stop using the service, and you can undo within that window (Apple). Download originals to every device you want to keep them on first.
Careful with other devices
An iPad or Mac still syncing with iCloud Photos will lose what you delete on iCloud.com. Turn sync off there too, with the download option, if those devices should keep a copy.
Keep your private photos off every cloud library
Secret Calculator Vault Photo (Calc+) keeps private photos and videos in its own encrypted vault, behind a working calculator.