I have struggled with that question for a long time! I still struggle with it.
James Chapter 1:
“12Blessed is the man who perseveres under trial, because when he has stood the test, he will receive the crown of life that God has promised to those who love him. 13When tempted, no one should say, “God is tempting me.” For God cannot be tempted by evil, nor does he tempt anyone; 14but each one is tempted when, by his own evil desire, he is dragged away and enticed. 15Then, after desire has conceived, it gives birth to sin; and sin, when it is full-grown, gives birth to death.”
I have to keep thinking God is in control and He makes good stuff out of old junk *like me*. I can’t describe it any other way than that.