Hi there, Photos is an app that edits and organizes photos, while the .photoslibrary is a destination that holds all your pictures. If you delete the .photoslibrary, all the photos go away as well. You can find this system file in Mac Trash, if it stays there, select it to choose Put Back immediately.
If the system file doesn't exist there, you should stop any writing action and try data recovery software to scan for the deleted files. iBoysoft Data Recovery Software helps a lot in scanning for any file traces on your Mac, you can give it a shot!
You can launch this utility to free scan for the deleted files, once they are found, you can then recover them with ease!
Good luck~