While Joseph Smith translated the golden plates out loud, Oliver Cowdery wrote the scriptures down. When they read about being baptized, they asked God how baptisms were supposed to happen. In answer to their prayer, John the Baptist came and gave them the Aaronic Priesthood and taught them. Joseph baptized Oliver, and then Oliver baptized Joseph. Later, Peter, James, and John gave Joseph and Oliver the Melchizedek Priesthood.
Find more Church history figures at lessonhelps.lds.org.