The original MIDI protocol specified a five-pin DIN connector (DIN stands for Deutsche Institut für Normung, a German standards organization), which is what you'll find on older legacy MIDI gear (anything made before 1999).
5-pin MIDI out and MIDI in jacks were the original MIDI connectors, and are still in use. However, today most MIDI gear sends and receives data to computers over USB. A single USB cable can not only carry 16 channels of MIDI IN and 16 Channels of MIDI Out on a single cable, but even multiple ports (1 Port=16 MIDI channels In and Out).
You can't connect five-pin DIN connectors directly to your computer. So what do you do?
Use a newer device with both USB and five-pin DIN connectors as a bridge
Some modern devices have only USB (so you can only connect them to a computer), but many have both USB and five-pin DIN. If your newer device has both, you can connect your older non-USB gear to your computer by connecting your older device to the newer one. The newer device will allow you to route MIDI to and from your computer to the five pin DIN In and Out.
Get a MIDI Interface or an Audio/MIDI interface with five-pin DIN connectors
Many audio interfaces have a USB connection to the computer that also includes sending and receiving MIDI data. So you should look for an audio/MIDI interface that has five-pin DIN connectors on it. There are also simple MIDI interfaces with just a USB connection and a pair of five-pin DIN connectors.
Get a USB to MIDI Cable or a Wireless Adapter
There even MIDI interfaces which look like simple cables, which makes them very convenient if you have an instrument or two that you need to connect to your computer via USB. But don't be fooled if you look closely, you'll see that there are small circuit boards in them. You cannot simply wire a USB cable to a pair of five-pin DIn connectors and expect that it will work.
You can even go wireless with the Yamaha Wireless MIDI Adaptor MD-BT01
Simple and easy wireless connection of instruments with MIDI IN/OUT terminals to iOS devices and Mac makes it easy to use a wide range of music applications wirelessly for even more enjoyable performing and composing.