This works differently depending on whether you have a magnetic spinning disk drive or a solid-state drive (SSD), which you'll find on most modern computers.
Your computer mostly erases the information that points your computer to that chunk of data, which will remain until it gets written over. The good news? When you delete a file on a drive, all that data doesn't immediately go away. Any actions, even installing a recovery app, risks overwriting the files you need. The first step: Remove the hard drive from the device if possible, or otherwise stop using it.