for every time this question has been asked ;-)
Two basic ways.
Either use ICS - Internet Connection Sharing, or use a Router.
ICS, means the machine connected to the net must be on when internet access is required by EITHER machine.
A Router, means each machine has independent access in it's own right.
If the machines are not networked at present, you need to choose between a WIRED connection, or WIRELESS connection.
It's a complex subject, so click here for some basic reading.