Gravitational lensing, which occurs when the light from distant objects is bent as it passes by matter, is a uniquely powerful tool in astronomy. It allows us to make direct measurements of the unseen components of the Universe, including dark matter and dark energy, which dominate the Universe around us but are not understood. Explaining these two dark components remains one of the key unresolved issues in fundamental physics today. This lecture will introduce the basic physical principles of gravitational lensing and show how it can be used on cosmological scales to measure the properties of dark matter and dark energy. The focus will be on a gravitational lensing technique known as 'cosmic shear', which has allowed us to map the three-dimensional distribution of the dark matter around us. In addition to its potentials in exploring dark matter and dark energy, the utility of gravitational lensing extends well beyond cosmology. It can be used to measure the detailed dynamics of stars, as well as detecting large populations of Earth-like planets outside our solar system. We will conclude by discussing how on-going and future experiments in cosmic shear will continue to give us unprecedented insights into the inner workings and evolutionary history of the Universe.