I am a DIY beginner. If I am installing polystyrene over drylocked basement walls, do I need a vapor barrier? Do I put the studs on top of the polystyrene? So, from exterior to interior it would be: basement wall, then dryloc, then polystyrene, then studs?
It's not so much a vapor barrier that you need as an air barrier. The moisture is carried on air, so if you block off the basement walls from air movement, you've all but eliminated moisture transport. Vapor diffusion is dramatically overestimated, and besides, most of the foams are very vapor closed anyway. No need for an additional dedicated vapor barrier material.
So what you want to do is cover the walls with an insulating material that's also an air barrier, such as EPS, XPS, or polyiso foam. Then you tape the edges and seal the boards to the floor and the top of the wall. That blocks air movement from the basement to the now-colder basement walls. Then you use spray foam to encapsulate the rim joists and seal off the top of the foam you've put on the walls. If you do all of this right, there will be no way for air in the basement to touch the walls or rim joists.
Once you've done all of that, you can safely build a stud wall over the foam and fill it with whatever kind of supplementary insulation you want (I recommend cellulose or mineral wool, not fiberglass).