This depends a bit on the electronics of your network card. Luckily you can test it easily.
In theory, two PCs cannot be just connected by a straightforward Ethernet cable. In theory, you must have a network switch in between, which for various reasons is a good idea anyway (since it has LEDs so you can SEE what is going on). Such a thing is about $20 for a 4-port one and you can find many of them second-hand. If you have an internet router, there is all the chance it already has four ports.
In previous times, you could buy special crossover or null Ethernet cables that had wires flipped, specially for connecting two PCs directly. However these would shut down any network with a switch in it, so they were considered "dangerous".
Today, most Ethernet cards in anything can detect flipped wires and will just adjust to whatever you use them for.
Hence, connecting two PCs with a straight-through Ethernet cable should be no problem.
You would need to set up either PC with a static IP address, so that they don't start asking each other for one using DHCP. And then simply ping either way to see whether it works. Do you know how to do this?
Lastly... if both your PCs are already connected to a WiFi router, they most likely already can see each other anyway.
Hoppie