Hi Maddy737,
Why do you want to do this in the first place?
The OOTB Packages have most of the code that is needed for proper functioning of AEM. How would you know which ones to keep and which ones to delete?
If you are looking for a production ready instance without the sample code, then you can start AEM in nosamplecontent run mode.