The cogs will only go on the hub one way, if you have them backwards they won't go on. I always line up the smallest spline on the hub with the smallest spline on the cog for assembly. do that and if it won't slide on after some jiggling, flip it. On shimano cassettes the numbers are stamped on each cassette on the outboard side (not sure about Sram).
There are spacers built into the pre-assembled cog-sets including a spacer at the small end. After putting the pre-assembled cog-sets on the hub, put the biggest loose cog on next, then a spacer, then the next largest cog on and so forth. Don't add a spacer between the first free cog and the pre-assembled cog set, or between pre-assembled cog-sets. The last couple cogs have a spacer built into the cog so you don't need one for those. When done, you should have the same spacing between each cog which is easy to see from visual inspection. If you see 2 cogs together with no space, or extra space, you messed up.