Tech companies say they’re cutting costs as they invest more heavily in AI, which is reshaping how people work.