Most pro (and quality home) recording is done with a large-diaphragm directional (cardioid)
studio condenser mic. A stage/performance mic can also be used.
Although condenser mics can be used for almost anything, they have a built-in "head amplifier" that can sometimes be driven into distortion if you stick the mic in front of a loud guitar amp or in front of a kick drum. Some condensers have a "pad" (an attenuator switch) for these situations. You probably won't be recording a super-loud guitar amp, but a Shure SM57 is popular way to do it. The SM57 is a dynamic mic (no internal electronics) and it's almost impossible to overload.
Stage & studio mics are low-impedance balanced with XLR connectors.
They are incompatible with regular soundcards and laptops, so you need a
USB audio interface with one or more microphone inputs. If you're recording electric guitar direct, some interfaces also have guitar/instrument inputs.
Studio condenser mics require 48V phantom power which will be supplied from the interface. Dynamic mics, such as the famous Shure SM57/58 don't require power but they do use the same balanced low-impedance connection.
If you do buy an interface, I recommend looking for one with zero-latency hardware-monitoring. There is latency (delay) when you monitor yourself through the computer. If the latency in your headphones is too long, it can be difficult to perform. You can tweak the latency and often get it down to an acceptable/unnoticeable amount, but it's just easier to avoid the problem altogether. (You can still monitor the backing track from the computer.)
Another option is a
"studio style" USB mic. These essentially have the soundcard/interface built-in. Some of these mics have features such as built-in headphone jack for zero-latency monitoring, and adjustable gain controls, etc. But, some of these USB mics also have a reputation for noise which gets-in through the USB power. (USB powered interfaces can have the same noise problem but it seems less frequent An interface with it's own power supply will avoid that problem, but it's generally going to cost more.)
...Quality recording also requires a good performance, good microphone positioning, and a quiet "studio" with good acoustics (usually sound-absorbing acoustics are desirable).