How to clean Xcode build files?

When I tried to use Xcode to compile an app for my iPhone, it also compiled a macOS version, but they don't work. I tried to delete them from the Applications folder, but they're not there. According to the Xcode logs, I found that they're located in /private/var/folders/ and there are some deprecated projects. How should I delete them?

How to clean Xcode build files?
 
 
Q