If both devices are using iCloud Photos - with the same Apple ID – then deleting photos on either device will cause them to be deleted everywhere. On the iPhone, on the Mac, and in iCloud.
If you are going to keep your iPhone 14 connected to iCloud Photos (generally a good idea), then you need to make copies of the photos outside of the iCloud Photos system, before deleting the iCloud Photos ones.
There are various ways of doing this. E.g., export photos; turn off iCloud Photos on the Mac ONLY while telling the Mac to download and keep copies of the originals (so you now have a local library that's a copy of the iCloud one), etc.
Note you can have multiple Photos Libraries on a Mac. Apple does not make it easy to move photos between libraries – but if you hold down the Option key when launching Photos, you'll get a dialog that will let you create or select a Photos library.
All of the libraries except for the "system" library are local – their contents do not take up space in iCloud or on your iPhone. Whether the photos in the "system" library take up space in iCloud and on your iPhone would depend upon whether you were using iCloud Photos on the Mac.