I don’t understand prayer very well. If its against God’s will, then it won’t happen. If it is in line with God’s will, then it will. So…don’t you get the same outcome whether you pray or not, the outcome being God’s will?
You don’t understand God very well

God is a Father. If you want, say, a hug from your Father, it is certainly in line with his will, but if you don’t ask, you won’t necessarily get it. Same for advice, or help, or anything we can come up with.
God obviously provides for us, but He is neither our servant nor an abstract entity - He is a loving Father with whom we are called to have a true personal relationship.
A love relationship is never from one side alone - it requires that two parties move towards one another and take steps to show love towards one another.
In our case it is somewhat easier, as imperfect creatures, to love the Lord: “we love Him because He loved us first”. Sometimes the bitterness of life can make this hard to grasp - but this is not just true for God…it also applies oftentimes to our parents on earth, to our relatives, to our loved ones…we cannot deny the perfect love bound that connects a father and his children, but often bitterness on one side (or both) can injure the communion and require that one (or both) parties take steps towards reconciliation, and that the other (or both) parties be open to repentance, forgiveness, reparation.
When we take those steps towards God - whom we truly understand
solely when we read how Christ spoke and behave, as a truly kind God who loves us to folly - then we always,
always find that God responds to us…or rather, when we take those steps is like opening a door and finding that there was already someone knocking outside. This may sound simple-minded at first, but anyone who has experienced a conversion or has at some point had the personal encounter that all believers have with God can confirm this experience.
Prayer then becomes that communication that is essential even between humans for relationships such as between parents and their offspring, brothers and sisters, husband and wife…how much more essential is communication between us and Him, children and Father, spirit and Holy Spirit, soul-bride and Christ-bridegroom…and how much more when the barriers of our limitations and imperfections are wholly lifted if the other party is the Creator, whose specific trait is to be able to listen to each of us individually as if we were the only son…if only we were to trust in Him, we would truly see Him, whether in joy or amidst the harshest sorrows, whether in opulence or in misery.
Truly, if God’s will would always be done without requiring man’s active cooperation and assent, we would live in a heavenly world. But if the image of the crucified Savior teaches us anything, it is that no matter how grand may God’s love be, man must be willing to cooperate, even when this means to do things for others, bear sufferings for others, even sometimes spend our lives for others…and we do not need to look at those who sacrifice their lives literally to save someone, or to those who consecrate their lives to missionary work…sometimes this is as easy as turning our head and looking at an old parent or grandparent who dedicated the largest part of his life to providing for his family, or looking at a clock as we wait for a husband or a wife to come back home from a long day of work.