Accidents cannot be prevented even if utmost precautionary measures are carried out in a firmest possible way. However, accident occurrence can be highly reduced through a properly trained person functioning with the appropriate resources and correct attitude.
Most accidents are the result of several unrelated errors. The foremost object is the maintenance of proper records pertaining to the aircraft starting from the raw materials used in the production to the whole team involved in designing, drafting, manufacturing and maintaining the aircraft. That way, it would be easy to locate where exactly it went wrong in case of accidents, thus preventing it from happening in the future.