Full uninstall of an app

Hello all,

I am wondering if anyone can help me with writing a script that fully uninstalls an app with one click or can point me to a script already written please? So that when I click the script it uninstalls the app and leaves nothing behind. So when I click finder and use the search function with the name of the app, then click add and then name matches (input name of app) then click add and select system files are included, nothing comes up as the script has completely removed it from my system.

I am Using Mac Mini M2 Pro 16gb ram and macOS Sonoma.

Thank you

Full uninstall of an app
 
 
Q