Ideally, yes, you would react elemental carbon C(s) and elemental oxygen O2(g) at 0°C and 1 atmosphere, controlling the temperature at 0°C and measuring the amount of heat you removed to keep the temperature at 0°C. However, as you know, carbon doesn't really react well with oxygen at 0°C, and you would be waiting for several centuries to get a result. Instead, you would measure the energy required to raise the elements to a good reactive temperature, run the reaction at that temperature in a bomb calorimeter so you could measure the amount of heat generated by the reaction, and measure the amount of energy released cooling the products back to room temperature. The total heat of the theoretical process of running the reaction at STP can be calculated by making measurements of the actual processes required to run the reaction at some other temperature and pressure, and adding or subtracting as appropriate the amount of heat involved in changing the temperatures or pressures of the components of the reaction.
Like calculating the distance and direction between your house and the school. There may not be a road leading directly from your house to the school, but you know that if you can get there by going three blocks east, turning left, going two blocks north, turning left, going four blocks west, turning left, going 1 block south, turning left, and going 1 block east, then your school must be one block north of you.