How to sand wood without flattening it
Use sandpaper and your finger, or the edge/corner of a sanding block.

Though if you're just trying to remove paint I might first try using acetone or other solvent.