Humans are remarkably flexible tool users. We not only recognize a wide range of existing tools, but also produce new tools by seeing objects in new ways, or by making or repurposing objects to solve a problem confronting us. Here we study the cognitive processes supporting flexible tool use, including deciding what makes a good tool, and how it should be used. Participants played a video game which requires selecting an object from a set of options and placing it in a virtual physical scene in order to accomplish goals such as tipping another object over or launching it into a container. People appear to use a combination of simulation-based planning and experience-based heuristics: fast heuristics drive the initial selection and placement of a candidate tool, and that solution can then be refined by several rounds of mental simulation interspersed with trial-and-error experimentation to rapidly converge on goal-satisfying solutions.