You use a transfer pak which looks like this.
Hope this helps.
Comment the answer if it needs improvement.
Here is how it works:
Simply slide the Game Boy cartridge into a slot on top of the Transfer Pak, then plug the Transfer Pak into a controller slot of your Nintendo 64. Also, the Transfer Pak allows you to play certain Game Boy games on your Nintendo 64, so you can take advantage of the console's comfortable controllers and the big, bright picture of your home TV. The color and design of the Transfer Pak perfectly matches the original Nintendo 64 console. - Amazon.com