The following may also be of interest then if you are using iCloud Photos. While the erase procedure described in the previous post won't erase them, the following describes how they can be lost via manual deletion. It's always a good idea to have a backup to an external drive. If Optimize Storage is not turned on for Photos, there will be a local copy on your Mac as well as a copy on iCloud and the local copy can be backed up by Time Machine. Back up your Mac with Time Machine - Apple Support
iCloud Photos is a syncing service. Any photo you delete from a device where iCloud Photos is turned on will also be deleted from iCloud and from any other device connected to iCloud Photos. You can potentially reduce the storage space required on a device by turning on Optimize Storage. See the following Apple article for more information: Set up and use iCloud Photos - Apple Support