For a project, I need to use a Raspberry Pi 2 to control a 12V car window motor. To save space, I also need for them to use the same battery. The motor will need to work at a low speed but have a hight torque. From research, it seems I might need to use an h-bridge to slip the power and control the motor, and then a UBEC to lower the voltage for the Raspberry Pi. But I'm not sure if that is correct. What I also don't know is what type of battery to use and how to make sure I don't burn out any components. Would a low voltage and high current battery be best? And will an h-bridge be the correct component to handle a high current? And will all of this be able to connect together? I can give more information if needed.
The car widow motor has a worm gear that makes it operate at a low speed and high torque as it is, supplied by 12 volts. You should determine what its speed is with a 12-vlot supply. Then determine if your project needs to operate at just one speed or over some range of speeds. Determine the maximum and minimum speeds that will ever be needed. If the maximum speed is less than the motor speed for 12 volts, it would be best to add some means like a belt an pulleys to to reduce the speed further mechanically. That will further increase the available torque. Reducing the speed mechanically to the maximum speed required will most efficiently use the motor. Electronic speed control should be used only to provide adjustable speed, not to reduce the maximum speed.
You can use a single 12-volt battery or power supply to power both the Raspberry Pi and the motor. You will need a voltage regulator to reduce the voltage to 5 V for the Raspberry Pi. You will need some noise filtering to prevent noise from the motor's commutator from interfering with the Raspberry Pi.
A PWM controlled H bridge can be used to control the motor speed by reducing the effective voltage from 12 volts.
The battery needs to be sized to supply the maximum total current that the motor and Raspberry Pi might need. The loads will only draw the current they need. There is no need to worry about excess supply.
The Raspberry Pi runs on 5V, and you say the motor runs on 12V. So you've got a few options, and your end decision will be best decided by what voltages you have available; if you're keeping this window motor in the car, you'll have 12V from the car and you can use a linear regulator or switching regulator to create a 5V supply line on which you can run your Raspberry Pi.
You mentioned battery though, is this going to be battery powered? If that's the case, yes you'll want relatively high current; depends on what the motor draws. Lithium-ion might be the way to go.
H-bridges are for driving motors, yeah. I can provide more details for whichever branch you need, I just didn't want to put details for every option if you didn't need every option.