This idea is known as "checks and balances".
Basically, the idea is to make sure that not all the governmental power is concentrated in one branch.
For example, the legislative branch can make laws, but the executive branch can veto (reject) those laws.
The executive branch (the President) can nominate people to the Supreme Court, but it needs to be confirmed by the Senate. In fact, any time the President wants to hire someone to fill a government position, he or she needs approval from the Senate.
The judicial branch can declare both laws made by the legislative branch and executive orders made by the executive branch as unconstitutional.