This could take a four page post to cover it all. The chapter in John Palmer's book covers it really well. What you want to do first is figure out what kind of beer your water is suited for, which will mean looking at your residual alkalinity. Check out this page
http://www.howtobrew.com/section3/chapter15-3.html and use the nomagraph to figure out the style your water is best suited for.
If your water is failry hard (has high CAC03) you might need to cut your water with RO water to get that under control. For instance, light colored beers are best when the CACO3 is under 50, amber beer between 50 and 150 and up to 300 and even more for dark beers (or around there. I'm not sure if those are specific numbers - just off the top of my head.)
You also want to be sure your Calcium is at least at 50ppm. You can adjust that with CAlcium chloride (Cl) or gypsum (So4) which will also help lower the mash pH if needed. There is also a ratio of So4 to Cl you will want to target for certain beers. For instance, if it is a hop focused beer a good ratio would be So4 to CL 2:1. For malt focused beer you reverse that (So4 accentuates hops, Cl accentuates malt).
Of course, before all of that pH is the main focus and I normally use So4 or Cl to lower the pH and Calcium Carbonate (CAC03) to raise the pH. Remember that lighter beers will tend to have a higher mash pH and darker beers lower pH because the darker malts acidulate the mash.
I am missing a bunch of stuff but hopefully that will give you something to start with. I'm sure others will chime in to add or cover something I missed.