See the article Use iCloud Photos on iPhone - Apple Support
Turn on iCloud Photos
Go to Settings  > [your name] > iCloud > Photos, then turn on iCloud Photos.
Save space on your iPhone
iCloud Photos can help you make the most of the storage space on your iPhone. When Optimize iPhone Storage is turned on, all your full‑resolution photos and videos are stored in iCloud in their original formats, with storage-saving versions kept on your iPhone as space is needed.
Optimize iPhone Storage is turned on by default. To turn it off, go to Settings  > [your name] > iCloud > Photos, then tap Optimize iPhone Storage.
Sign in with same Apple ID and password of iPhone with account credentials at www.icloud.com from a web browser .
If photos are in series , leave the first photo and hold the shift key click on rest of photos to get selected .
Right click on any one of them and click on delete .
The photos will be deleted from the photo library of Mac and all other devices signed in with same Apple ID and password on the same network , as well on iCloud.com