What helped me the most was preparation. I spent a full month studying for the theory test. I used this website a lot, but I’d also really recommend Körkort.nu — using both together worked well for me.
I’m already used to driving and had experience driving in Sweden during my first year here, so that definitely helped. I’d suggest taking some time to actually practice driving, especially focusing on road signs, roundabouts, the “priority to the right” rule, etc. It’s even better if you can get familiar with the exam area before the test.