How to safely erase your iPad, iPhone or Mac before returning it

Don’t return (or sell) your iPhone, iPad, or Mac without erasing it first.