New Medicine Cabinet - Stud Removal
You can do a number of things here:

Shorten the stud board coming down to the header and move the header up 1.5” to 2” inches (I would do that ) - a nice oscillating cutting tool would make that easy to do right in place.

I would then install my cabinet - and I would have a sturdy upper frame for it as well.

You could remove it , replace it with something thinner .. but really why spend the extra money for wood - just cut the stud board and move the thing up the distance you need.