Microsoft Corp. will offer buyouts to about 60,000 workers, representing roughly a quarter of its total staff, as part of the company’s efforts to trim costs and retool its workforce for the artificial intelligence era.