I’m a little confused about prayer. Hashem is only good. He only does good to us, and gives us things for our ultimate benefit. If someone has a medical problem why would he pray for it to go away? If that person has complete emunah and bitachon in Hashem that He only does whaat’s good for him and with complete love, then why would he ask for it to go away, more than that, how could he say to Him, "I know 100% that You only do good for me from absolute love and I thank You for what you’ve given me... but please take it away". And if you want to say that Hashem just wants that person to ask Him to take it away, and then He will, if that person was smart he wouldn’t ask because he knows that isurim remove sins, which in turn brings him closer to Hashem. So it would seem he’s better off not asking in the long run since he’ll be closer to God in the end.
Many questions regarding God can be understood with the help of the Father-son parable. The Sefer HaIkarim explains that there are 3 categories regarding what a parent will grant a child. Some things he parent will give even if the child doesn’t ask. Other things the parent will not give, even if the child requests. The third category is that the parent may give the child his wish, if the child asks nicely. Being that we don’t know what issues are in which category, we always daven and pray, for often it may be in the 3rd category. In addition, speaking to Hashem brings us much closer to Him, gives us security, helps us define our goals, strengthens our respect which brings us to want to emulate Him, etc. etc. which in the end, are usually a lot more important and beneficial to us than most particular requests. Prayer is not just requests.