Prepositions can be tricky in Spanish as often they don’t translate perfectly from English. Regular practice is the key to dealing with prepositions.
Start here by doing this exercise that focuses on a, de and en:
This link does a good review and then offers a practice quiz by hitting the green button: