If you happen to be on a hike and see an orange "X" on a tree, you might think it is just there so someone knows to cut that tree down but actually, the "X" is a warning. The symbol is used by the U.S. Forest Service to let people know they are about to cross a boundary - typically one on the edge of property owned by the government. Because of that, if you see an orange "X" on a tree, your best bet is to turn around and walk back in the direction you came in.
With that, just because you see orange on a tree, doesn't mean you are about to break a rule. If there is an orange slash on a tree, that does mean it is designated to be removed. Meanwhile if you see a dot at head height, it means the tree needs pruning, but if you see one on the base, it means it needs treatment for an issue like blight or borers.
You might see other marks on trees too, including a white circle. So what does that signify? Well a specialist at the University of Illinois. told Family Handyman that it means the tree is home to an endangered species. They explained, "That is the case with the federally endangered red-cockaded woodpecker in the Southern United States. Their tree nests are generally marked with a white paint ring."
As for if you see a purple square, that means no trespassing so again, walk back from where you came.
Of course, markings and colors are not universal so sometimes an "X" might actually mean for a tree to be removed. Typically though, if you see red paint, it also often means that the land belongs to the U.S. Forest Service.
Sometimes you might see the entire trunk of a tree painted white but if you do, you don't need to worry too much about it. That is just to protect the tree from sunscald, which happens in the winter when bark cracks due to the changes in temperature between the cold at night and the sunny days. It can damage trees and make them susceptible to pests.
Finally, if you ever see a square of black paint on a tree, you can just ignore it since it is likely just covering up other paint that was put there by mistake.