UPS will lay off 12,000 workers and says it is ordering employees to return to the office five days a week.