Exactly, the heat has to go somewhere. Even a refrigerator that cools food has coils on the back that produce heat, it's more of a heat transfer than just making it 'go away'. Air conditioners work much the same way, they blow cool air into the room and vent heated air out of the room outside if a window unit or outside if a central air unit. Either way it's a matter of heat displacement/transfer from one area to another. In the pc, it's from the heat source (cpu/gpu) to outside the case.
Either an air conditioner in the room or some sort of air collection tube gathering most of the exhuasted air from the pc with a fan to drive it out through a hole in the wall or through an open window.