When most trees get over ten feet tall, they seem to be trying to grow every way but up. Staking would be impractical because of scale, and pruning often helps but does not force the tree to grow up. What is the best way to keep them growing straight?
Trees change shape as they grow. The silhouette of a young tree is quite different than a mature tree. The shape is also influenced by the species or cultivar, exposure to sun and how crowded it is.
If you want an arrow straight tree the easiest way is to plant a cultivar that grows that way like Gingko biloba "Princeton Sentry". If the tree is already planted you could plant fast growing upright trees around it which will encourage it to grow straight up. Gradually thin these throwaways as the years go by.