I have a shapefile data of buildings. I added it to GeoServer and serve it as a WMS layer. When I check my own maps in the browser my polygons of building appear black color and I want to change it's color.
What am I supposed to do ??
Geoserver layers have associated styles. These styles are written in Styled Layer Descriptor (SLD), a subset of XML. To change your styles, you'll have to edit the SLD. In Geoserver, the SLD can be edited using the Style Editor in the Styles Page.
Pretty ain't it? Fortunately, you don't have to edit the Styles by hand. A workaround is to use a GIS package like uDig to style the layers using a GUI. Just load the shapefile in uDig and style as desired. Once you're satisfied, you can export the SLD and upload it to Geoserver. Or you can load open it on a text editor and then copy paste the contents into Geoserver's Style Editor.
Hopefully that should be enough to get you started. If you really want to get your hands dirty though, you might want to check out the SLD Cookbook. It should give you an idea of how to change the SLD by hand. Good luck.
If you generate your shapefiles in QGIS, you must save your styles along with the rest of the shapefile.
Adapted from this answer to a similar question