If what you need to do is 'increase the height of the hole by a quarter inch', then the safest solution is to get a replacement medicine cabinet that will fit in the existing hole.
If that's not possible, then use a saw to remove the stud that's in the way. After that, you'll need to repair the inevitable drywall damage that'll be left by the saw. This will be easier than sanding.
Regarding the type of saw: Use whatever saw you're comfortable with. There are a lot of saws that will work. You should prioritize keeping your fingers attached to your hands.
I would use a skillsaw with a CARBIDE BLADE to make a vertical cut through both edges of the lower stud, then pry it out. That type of blade will cut through the nails that you're going to hit when you make this cut. Go slow, and keep a fire extinguisher and first aid kit nearby.
Assuming you removed the stud without hurting yourself, repair the drywall damage, then install the new taller medicine cabinet!