In general: you make models of the sun, and then you see which one agrees with all observations, and check which temperature this model predicts for the core.
A very simple model that gives a good approximation: fusion happens within a small volume in the core, and a part of the released energy is transported to the surface afterwards until it can escape as light. We know how much light the sun emits, and you can calculate the necessary temperature and density gradients inside that is required to transport this power and to keep the sun stable. Work from the surface inwards and you get an estimate for the core temperature.
Another nice approach is the fusion rate - this is known from the total power as well, and it can be compared to the fusion rate the sun would have at different temperatures.