Britain gained control of the Suez Canal in two main steps.
First, Britain took partial control of the canal in 1875. This happened because the ruler of Egypt was in serious financial difficulties. He owned a large bloc of shares in the canal and sold them off to take care of his debt. This gave the British partial control of the canal, but they still did not have complete control of it because the majority of the shares were owned by the French.
Second, in 1882, Britain essentially took control of Egypt as a whole. This time, they came at the request of the ruler of Egypt (the son of the ruler who sold the shares). The ruler of Egypt was faced with rebellions from within the country. He asked the British to come in and give him military help in resisting the rebellions. Once there, the British stayed and essentially occupied Egypt. This gave them control over the canal.