Plug in an ethernet cable. To connect two computers that don't have access to a shared network, you can use an Ethernet cable to make a direct connection between the two computer's Ethernet ports.
Some computers require a special cable called "crossover cable." This is a specialized cable that is wired in reverse. Ethernet ports have both inputs and outputs, and the crossover cable is switched so that the output from one computer connects to the input of the other.
Many current computers do not need a crossover cable: they use Auto-Medium Dependent Interface Crossover (Auto-MDIX), and will automatically configure the Ethernet port.
Most Macintosh computers built recently do not need a crossover cable.
If you're not sure, check your documentation to see what your system needs. If that's not available, just use a crossover cable: an auto-sensing Ethernet port will work with a crossover cable just as well as with a standard cable.