WHAT to produce? A society cannot have everything they want so they produce what is in demand.
HOW to produce? The best option for the line of production is one of 2 either you have more machines than people doing the job or more people than machines working. The two factor when making this decision is what cost less and the other is what produces faster.
For WHOM to produce? You have to have a target market for your product such as the types of people you expect to but your product.