Why do we pray to god. When we are doubt full of the outcome of an event and are not fully confident that we will succeed. And so we approach god for reassurance.
What does praying regularly do. What does constantly thinking about something do. It helps you concentrate and focus more on one thing and when you put lot of thought and energy towards something you obviously find better ways to achieve your goal and the chance of success is more.
Bhagavad gita says that prayer alone will not give you fruits and neither will shutting yourself from the world and praying lead you to salvation. You need to make your effort to the best of your ability and then leave the rest to god.
This question cannot be answered on just a blog. Perhaps you should some research for yourself. Listen to Bhagavadgita and most of your doubts will be cleared.
You can start with the below beautiful rendition. It spells out Sanskrit verses and its hindi meaning in a pleasant and pleasing way.