Layoffs have hit companies including Amazon, Pinterest, and Target this year as AI and economic conditions reshape the business landscape.