If iCloud photos is turned on, then all of your photos and videos are located on Apple's servers, not on your devices. Your devices that link to iCloud photos are showing you what's on the iCloud server. If you delete any photo or video from any device that uses iCloud photos, the file on Apple's server will be deleted and none of your other devices will be able to see it either.
If you want to save some photos or vids but delete them from iCloud, you need to copy them to somewhere else besides the photos app. Then that file will be viewable only on that device (unless you copied it to another web server).
People don’t seem to realize that iCloud isn’t a cloud storage device, it’s a cloud syncing service.
As already mentioned, if you want cloud storage you’ll need to look elsewhere (GDrive, GPhotos, OneDrive, etc.)