You can take only precautions never to let it happen again.
You can protect the Recently Deleted album with your Code, so nobody but yourself can access it, see: Delete or hide photos and videos on iPhone - Apple Support (EG).
If you told someone your code, change it asap and never tell anyone again your code. The same goes for the password of your Apple ID.
To prevent yourself from accidentally deleting important photos, make sure, you are seeing what you are about to delete.
- When you are selecting photos for deletion, look at the total number of selected photos. if the number is too high, deselect the photos again.
- Keep the Recently Deleted album relatively empty, so you can see at a glance what is inside the Recently Deleted album. Do not use Recently Deleted as a buffer to store photos that you do not want in your library.
- And make sure, you have at least one backup of all your important photos. Be aware, that the iCloud backup of your iPhone will no longer include your photos, once you start using iCloud Photos. You will need to keep safety copies of your photos somewhere else, outside iCloud Photos, so you can recover accidentally deleted photos. Save them on a computer, for example.