Be careful here. iCloud is NOT a backup. It is a syncing service. If you sync photos with iCloud and you can confirm by:
Opening the Settings App. Tap your name at the top. Tap iCloud. See if the switch is on for Photos
If it is, when you delete photos on your iPhone, they will simultaneously delete from iCloud.
On your iPhone, when you delete photos, they transfer to a folder called Recently Deleted, where they stay for 30 days or you can permanently delete before the 30 days is up.
If you are syncing photos with iCloud and you didn't delete the photos from Recently Deleted, you have the opportunity to return them to your phone, so you don't lose access to them forever.
If you really need space on your phone, you can safely store the photos on your computer, outside of iCloud.