Do you know what kind of paint it is?
What type of finish is on the shelf?
You can use paint stripper or sandpaper
I use CitriStrip to remove old paint from furniture. Here's how I used it on a small side table.
Heated up white vinegar also removes paint from wood.