STP creates a tree, starting from root bridge (thats why is a tree)

Since STP doesnt allow redudant paths (as old IBM bridging protocol provides), protocol will disable any path that cause a "loop".
However, when one path goes down, STP will re-enable that one (the loop one).
Its an auto-discover protocol. Just enable it and it will do the job by itself.
When enabled, all bridges (all switch ports) will "elect" a root bridge and start to calculate costs and discover loop paths.

When you need redundant paths, like between core and a office floor, you just use 2 cables between them. (2 ports on each side)
STP will elect one as active and other one as disabled.
If active fails, STP will re-enable the disable one.

Its easier that you think.