despite @ragingloli ‘s optimism, the answer is no. There are currently no geothermal or nuclear rescue locations ready for use.
It isn’t only light and heat that would be problems. Think about gravity and how that would change as the earth spun out of control.
For that matter, it’s important to know HOW, in your scenario, the earth moved out of orbit in the first place. Did it collide with an asteroid and got pushed? That would change things too.
Another question: in your scenario, how much warning would earthlings have before this took place? One day- would be a fiasco. Thirty years- we could build things.
Bottom line is that there are far too many variables, and questions to be answered before a truly accurate answer could be given.
My gut feel is that the human race would last less than a week.