Even though most computers already contain a "soundcard" with "Mic"-input, their quality often is limited to telephone sound.
For better sounding speech- or music-recordings, you need an additional soundcard, a so called "audio interface" which is connected via Firewire, USB or Thunderbolt to your computer (there are internal, built-in solutions also).
According to their exact configuration, they contain one or more XLR-connectors for professional microphones. A phantom power option also allows the use of condenser microphones.