If you need to relearn your brake pedal position sensor, there are a few things you'll need to do. First, find the sensors on your vehicle. They're usually located near the brake pedal itself or in the master cylinder. Once you've found them, you'll need to clear any codes that may be associated with them. To do this, disconnect the battery and allow the car to sit for at least 30 minutes.
Once the codes have been cleared, you'll need to reconnect the battery and start the car. With your foot off of the brake pedal, press and hold the learn button on your sensor until the light on it starts blinking. This indicates that it's in learn mode. Next, slowly press and release the brake pedal 20 times while remaining in learn mode. After you've done this, turn off your car and wait a few seconds before restarting it. The final step is to test your brakes by driving around safely at low speeds until you're confident they're working properly again.