Ok, imagine a solar flare happens right in my room, will that be enough to destroy the earth?
A source says to destroy the earth, 224M yottajoules (1 YJ = 10^24 joules) of energy is needed, but a solar flare can usually release 10^20 joules or large flares can emit up to 10 YJs, so a solar flare in my room can't destroy the earth. But the temperature inside a flare typically reaches 10 or 20 million, wouldn't that evaporate the whole earth anyway (thus destroy it)?
Hmm, there's a few things here. First, is that 224 MILLION yottajoules, or just 224 yottajoules?
But then there's the temperature. Temperatures in a fusion reactor (that kind of "clean" nuclear power that they've been saying for the last 50 years is going to give us free energy about ten years from now) reach that high, but it won't destroy Earth because it's a rather diffuse gas at that temperature, and if the "core" became unsealed and opened up, the gas would expand and drop in temperature immediately.
Also (thirdly?) a solar flare may well have lots of energy, but it doesn't all hit Earth. A flare spreads out from the Sun in a cone that's surely an angle of several degrees of arc, but the Earth is a small "target" for the Sun. The Sun takes up (IIRC) about a half degree of arc in Earth's sky, and its diameter is 100 times that of Earth's, so Earth would have only 1/200th degree of arc when viewed from the Sun (a dot, perhaps barely visible as a disc, maybe like Mars or Venus in Earth's sky). If the flare goes through an area as large as a basketball court, Earth would be about the size of a baseball, so most of the flare's energy would miss Earth.
That's not to say a really big flare wouldn't affect Earth ... long story short, it's complicated.
Since you posted in SF/F, I'm guessing you have a story in mind in which a solar flare occurs in your room (imagining the scientific likelihood of this, the story so far appears to be at least as much fantasy as science fiction). Maybe you could tell us how and/or why that happens, and ... well, do you WANT it to destroy Earth?