If you simply wanted to clear out posts, the safest way is to use the prune function in the control panel. You might need to run the "rebuild" functions in the maintenance menu afterwards.
Deleting the files manually is tricky, because you have to know exactly what all the files are, whether there are interdependencies among the files, which ones the UBB automatically creates, etc.