Hello and welcome to Tom's Hardware Forums.
You need to create a LAN or Local Area Network using a LAN cable to link the NICs or Network Inteface Controllers in each machine. A direct link is called an ad-hoc network but the more normal arrangement is to link each machine to a hub - usually a router, so that both machines can share the Internet connection the router provides or gets from the MODEM.
How do you connect to the Net?