WARNING: This page is about a different car, the 2007 Subaru Outback and 2007 Subaru Legacy. However, it is still accessible from the selected car via links, so may be relevant.
Disconnect the ground cable from battery.
Disconnect the stop light switch connector.
Loosen the nuts, and unscrew the stop light switch to remove.