Then what is the purpose of prayer?
"Then what is the purpose of prayer?"
Easy. Strength, guidance, and comfort so you can deal with a problem yourself instead of asking God for a miracle every time something goes wrong with your life.
Miracles by definition are exceptionally rare.