Combine 2 icloud photos on 2 different phones into one single icloud account
I would like to combine my 2 phones' pictures onto the same icloud, now it is separated into 2 iclouds. I am afraid if I sign out for one of the icloud, the photos in that icloud will be gone (since now it is under the optimized mode), being because icloud storage is not enough, so not sure if I login the other icloud, the original photos in phone A will be replaced by the phone B and icloud B. What is the safest way to do to combine into 1 icloud despite now photos are in 2 phones? Thanks!
iPhone 7 Plus, iOS 13