more info is needed to help you...............what is it you are trying to rewire ?? are the wires shown all that you need ??
The green wire nut has a white wire and the white wire nut has a white wire & they go together and use the white wire nut to screw them together because it is a better nut.
The black wire under the red wire nut needs another black wire that is loose and I don't see that anywhere so tug on the black wire that is above the red wire and see if there is a loose end. Then join the blacks together. You may use the green nut for that because the color shows the cap size and the red cap holds more than 2 wires together (like 4) That is why the nuts are colored different colors.
Then throw on the breaker switch. Wait 2 minutes or 5 and listen for a click. That means it is wired wrong. The breaker kicked off. You have to turn the breaker to the fully off position and go back and take another picture with the caps off so we can see all the loose ends.
Or pay for a certified qualified electrician to come and fix this up.
Because you did not mark it down before disassembly.
A very least we need a picture that more clearly shows the wires a little less tangled, voltage rating of heater, and confirmation that the metal flex goes to the heater.