The type of wood needed to build shelves depends on how nice you want the shelf to look when finished and how heavy the items to be stored on the shelf will be.
A solid wood option like pine that can be cut and worked easily is strong, takes both paint and stain well and is fairly inexpensive. Softwoods can split easily and need to be predrilled for screws.
Hardwoods are another solid wood selection and best suited for very high quality pieces that will be stained. Hardwood is strong and durable but is an expensive option.
Plywood is a manufactured wood that can be purchased in grades depending on how smooth and free of knots the wood needs to be. B/C plywood is fine for garage shelving but furniture grade is the right choice for use in living spaces. Plywood is not as expensive as hardwood and it is strong and easy to cut.
Medium Density Fiberboard is manufactured from powdered wood that has been tightly compressed and is held together with glue. It is soft, works easily, paints well but does not look good stained. MDF needs support over long spans and it can swell if it gets wet.
Made from chipped wood with a thin laminate, usually white in color, applied to the surfaces. Laminates are good for shelves intended to carry lighter loads.