(a) DNA sequences of the vector as well as the source are cut by the same restriction enzyme like EcoRI, in a palindromic sequence. (The cut ends overhang to as sticky ends in the medium.)
(b) These cut ends fragments are to be extracted from the culture medium using gel electrophoresis. This has an agarose gel matrix. Fragments are fed in the wells. They are negatively charged. So, they move towards anode under an electric field through the gel. Smaller fragments move faster, thus separated.
(c) Fragments are now added to the medium containing the vector DNA. The sticky ends facilitates the action of the enzyme ligase and join the source DNA to the vector.