The basic starting point is simple: play your ball from where it stopped.
Plain-language guide · Rules 1.1 and 9.1. Use the current official text and your round’s Local Rules for a ruling.
What to know
Move it only when a Rule permits or requires it. A difficult lie alone is not permission to improve it.
On the course
A ball beside a tree stays there unless you use an allowed option. You may choose unplayable-ball relief with a penalty rather than force a risky shot.