This may sound odd but I learned this from an old school carpenter when I first started. Get a 10’ piece of elastic from a craft store, mine is 3/4" wide. With a marker, make a line every 2 inches the whole length. Now you can stretch the elastic as much as you want until you get your desired spacing between lines. This will give you spacing and the number of balusters.
A 2 ft. 2x4. That way all of your spacing is the same. Put your first baluster up, then sandwich the 2x4 between the baluster just put up and the one you are about to nail. All of your spacing should be about 3 1/2 in. (width of a 2x4). Be sure to check for plum every few balusters. The balusters on each end may be closer depending on how it works out, but all in between will be the same.
A simple “story stick” is the easiest way. I use a rip of plywood or a long 2x4. Mark our your baluster width, then desired space, then baluster width, then desired space etc all the way down the length of your story stick. Then simply slide the story stick left and right between your posts and it helps not only lay out each baluster, but makes centering the run between posts very simple.
A (straight) 2x4 is my preferred method. Make a mark dead center between posts. Center baluster on mark and make sure it’s plumb. Then just work towards posts from center using 2x4 as spacer. Check for plumb every few balusters since wooden ones are prone to being warped. You will end up with perfectly symmetrical railings every time.