The main use for an Elephant Harness is to make Elephants and Mammoths rideable and so that extra items can be added to an Elephant, such as an Elephant Howdah, an Elephant Garment, an Elephant Chest and a Mammoth Platform for Songhua River Mammoths.
An Elephant Harness can be applied by right-clicking on a tamed adult Elephant or Mammoth. It can be removed by right-clicking on the Elephant/Mammoth with Shears. Elephants and Mammoths will also drop Harnesses upon death, or when a Scroll of Freedom is used. If a player 'sneaks' near their Elephant ('shift key'), the Elephant will sit for a short time, allowing the player to sit on the Harness by right-clicking on it. To dismount the Elephant or Mammoth, press the shift key once again.
Note: If an Elephant Harness doesn't work when right-clicking on your tamed Elephant/Mammoth, it takes a while for an Elephant or Mammoth calf to grow into an adult (about 4-7 Minecraft days). If you try to place an Elephant Harness on a calf while it is still growing up, it will not work.