Pair programming is when you get two (or three) programmers to work on the same piece of code on the same computer. Only one person is coding at a time and the rest of the people are being helpful in some way.
Think about what can happen if you have multiple brains working on the same problem. There are lots of benefits.
This wonderful article gives a bit more detail on the benefits of pair programming.
Pair programming works best if everyone gets a turn at the keyboard, team member roles get mixed around, and communication is prioritized. There are a few different approaches to getting this right:
This kind of pair programming works best when there is a natural cadence to the coding process. Eg: Alice writes a little function, then Bob writes a little functio, etc.
This works suuuper well when it comes to Test Driven Development (we cover TDD later in the course)
Basically in this form, one person is the driver (they drive the computer), and the other person gets to direct their efforts. The driver is writing all the code so they get to ask questions and suggest corrections if they think something is a bad idea.
In the absence of a plan, this tends to happen. It sounds like a terrible idea at first (if you fail to plan, you plan to fail) but it can work pretty well in some situations.
While you are still learning how to do this well, rather stick to one of the other styles.