For 2 years now I’ve been trying to become a better muslim and be close to Allah(swt). I would ask for closeness to him every prayer but I always get tests that take me away from him…and I don’t know what to do

When you want to get closer to Allah, the trial becomes more difficult. When you want to go to a good college, does the test become harder or easier?

When you go to the gym and you want to be more fit, do you work more or less?

The same applies to religion. Allah wants to build you and coach you and strengthen you. He wants you to work on your weaknesses—hence he tries you. Through such trials you have the chance to become stronger and better.