The term is "heaven sent". This means to be sent by God. It is a saying that means that when you are in a difficult situation that seemingly from nowhere the right solution arrives.
Our car broke down and it was raining. How would we get home? When from nowhere a bus arrived as if heaven sent.