To fix, you need get one from the dealer. Figure about $8-30 dollars dependign on how bad the markup is at your local stealership.
The brake circuit switch (and there are 2 on some cars...check yours) is located up under the dash under the steering column. Remove the ~4 screws holding the cover panel on. The brake light switch is under the top of the brake pedal arm, under the dash.
Make sure you press the red tab down to lock the switch in place. Use pliers to break the red tab off the old switch and pull out. Push the braked pedal all the way down to get the old swtuch out. Pop the new switch in and reconnect the wiring harness, but again be sure you've pressed the red tab to lock the circuit switch in place.
Now, if you are NOT getting a 'brake circuit' related error code on your E36's OBC, but rather a 'brake light failure' this means it is either a bad bulb, loose bulb, bad bulb socket, or dirty/corroded electrical contact somewhere where the bulb or socket tabs are. Any Auto Zone, Pep Boys, NAPA or wherever should have the correct brake light and high mount stop light bulbs. They are either # 7528 or 7506 depending on the year and model BMW, I believe (please double check and do not take this as gospel). Use emory paper and electrical contact cleaner to make sure the taillight electrical contacts for the bulb socket, and the bulb socket contacts themselves, are clean. Test the socket with an electrical meter. Tip: replacing your E36 rear taillight and brakelight bulbs at the dealer includes the socket for each bulb, and the price is usually under $15.