Good news: you don’t need to strip everything down to bare wood. Just sand the existing paint until it’s dull and scratched. This gives the new paint something to hold onto, like a monkey gripping a vine.
If the old paint is peeling or chipping, sand those spots smooth first. Otherwise, your new paint will peel off in sheets, like a snake shedding its skin. A snakeskin bookshelf might be trendy, but probably not.