You need the following components to connect two computers together:
- Two PCs with their NICs
- Straight cable
Connect two PCs together with straight cable and assign two different IPs from the same private class (suppose those two IPs can be 172.16.1.1 and 172.16.1.2). Ping one PC from other to confirm their connectivity.