Accidentally delete files from iCloud and Mac Trash, can I recover?

I unintentionally removed some crucial data from iCloud and the Mac Trash a day ago. How do I get them back?

Files deleted during the last 30 days from iCloud Drive and other apps can be recovered on iCloud.com, regardless of whether they were erased from iCloud.com or another device with iCloud Drive enabled. Nevertheless, files you have irreversibly erased cannot be recovered or restored.

Therefore, if you haven’t erased the deleted files from the Recently Deleted folder in iCloud and it hasn’t been more than 30 days since you deleted it, you can easily restore them. Go to iCloud.com, navigate to the iCloud Drive > Recently Deleted, or click the App Launcher button > Data Recovery, then select the items you want to restore and click Recover/Restore.

After you emptied the files from Mac Trash, you can only restore them with the available backup such as Time Machine, iCloud Drive, etc., otherwise, you can rely on third-party data recovery software such as iBoysoft Data Recovery for Mac to restore deleted files on Mac before the data is overwritten.