I may be mis-interpreting your question, but an extract on Tableau server can either be a published data source or a workbook. Both of which can be deleted by navigating to the object and clicking the ... menu option and selecting delete
There is no cleanup method provided by Tableau server that will 'automatically' do this for you. Some people do write their own processes using tabadmin/tabcmd to identify 'old/unused' content by querying the postgres database and then programatically deleting them. This isn't something I do personally. Instead I have reports that use postgres to identify when workbooks last accessed and then perioidcally these will be manually deleted off the server.
I wanted to know how can I delete the files created when I created an extract, basically when I delete an extract from tableau server I want to delete all .hyper files too.