Complex sentence: The magnetosphere is the region above the ionosphere and extends several tens of thousands of kilometers into space, protecting the Earth from cosmic rays that would otherwise strip away the upper atmosphere, including the ozone layer that protects the Earth from harmful ultraviolet radiation.
Split into simpler sentences: The magnetosphere is the region above the ionosphere and extends several tens of thousands of kilometers into space. Earth's magnetic field serves to deflect most of the solar wind, whose charged particles would otherwise strip away the ozone layer that protects the Earth from harmful ultraviolet radiation.