If the photos have been deleted permanently (removed from recently Deleted) and you have been using iCloud Photos, you need a backup on a computer to recover the photos (How to back up an iPhone, iPad, iPod Touch be able to Recover Accidentally, Permanently Deleted Photos - Apple Community).
Otherwise only third-party data recovery software can help. That is usually expensive, and may not recover many photos, if the photos have been stored in iCloud and not on the iPhone. You could try https://www.cleverfiles.com/iphone-data-recovery.html, for example, but look for yourself. Do not buy any software, that does not offer a free trial version, where you can see, what can be recovered, before you have to pay.