Sand the wood vigorously with the sandpaper. A sanding block or medium grit sandpaper (200 or so) works for wood already fairly smooth. For rough wood, start with coarser sandpaper (80 or 100 grit), then finish with the sanding block or medium grit.
Wipe the shelves down. Use a damp rag. Allow the shelves to dry.
Paint on the primer. Use the 2-inch brush. Paint with smooth strokes. Follow the grain of the wood. Don't worry about coverage. A thin, even coat is the goal. The primer does not have a lot of pigment, and it doesn't hide like paint. Allow the primer to dry.
Paint the shelves with the paint. Use the same technique as for the primer: thin, even coats applied in the direction of the wood grain. Use a semigloss paint for a more attractive, durable and simple-to-clean finish. It may mean an extra coat, but it's worth the trouble. Flat paint will look dirty from use quickly.
Apply a second coat of semigloss paint. You may need a third coat for full hiding and a solid color, depending on the color and the paint quality.