Building an electric bicycle is not hard as you maybe think. All you need is five parts: 1)motor, 2) throttle, 3) battery, 4) a motor controller that regulates battery power, 5) wiring connecting the motor, throttle and battery.
First, you need to find a good working bicycle that could be modified. Make sure it's appropriate and has good brakes. The basic bike must have space for the battery in the triangle between the legs or you will need a rack for a rear mount battery.
Before installing batteries, you need to explore the voltage of battery pack you possess before you start the search for other parts. Lithium batteries are the best. The most typical voltages for e-bikes are 24 volts and 36 volts. You can go even higher 48 volts.
Buy and mount a front or rear wheel hub motor kit that comes with throttle and controller. Install the battery, run the wires to the battery and you're off.