In your old device it could be your iPhone or Mac did the photos box was checked and it was checked the photos would have saved on the iCloud server , if in any case it was not , photos will never sync / saved .
See this article https://support.apple.com/en-in/HT209453
And in your new iPhone set it up see this article https://support.apple.com/en-in/HT202033
And sign in with same Apple ID and password used in old device iPhone / Mac that was used and set up iCloud photo library see this article https://support.apple.com/en-in/HT204264
And if it is Mac in photos preferences > check the box of download originals .
If you still possess the old iPhone see other method https://support.apple.com/en-in/HT201302
Note : the basic concept is in older / new iPhone the photos box should be checked so that photos get synced / saved on the iCloud server .