A compression sleeve works by compressing the veins and arteries in the leg, which helps to reduce swelling and pain.