You will see a large double pole circuit breaker at the top of the power panel called the "Main". It controls all the power to the branch circuit breakers below it. This photo shows a 100 Amp main breaker with the panel face plate removed.
Circuit breakers are controlled with a lever that places it in the "On" or "Off" position.
To turn the power off to this panel containing the main breaker, simply turn the lever to the "Off" position. This will now disconnect all power feeding the panel and the branch circuits.
Turning the main power off to the panel is required when you are replacing a breaker or adding a 120 or 240 volt circuit or doing any work inside the panel whatsoever. If you are working on an individual circuit and cannot identify the branch circuit breaker, then sometimes turning off all the power by using the main disconnect is a way to proceed. (Just be prepared to reset all your clocks!)