First off, welcome JordynMurdock to Tropical Fish Keeping forum. Glad you joined us.
Now, to your question. I'm going to explain compatibility, as you sound like a fairly new fishkeeper, so pardon me if this is old news; but it is the essence of success in this hobby, and many fail by not heeding this.
"Compatibility" in fish for a community aquarium--a "community" aquarium is one with more than one species of fish--involves many facets.
Water parameters are of prime importance, as other members have mentioned; some fish are somewhat adaptable to certain ranges, other fish are not. We have fish profiles, under the second tab from the left in the blue bar across the top of the page, and each contains a section of "ideal water parameters" which has the acceptable safe range for that species and includes specific comments where appropriate. Parameters includes hardness, pH and temperature, and all are important.
Filtration. Not all fish can live healthily with the same water movement, and this is largely determined by the filter. This also is noted in the fish profiles. Mixing fish that need quiet water, such as gourami, in with fish that need a current, such as hillstream loach, will always end in failure and death of one of them.
Decor. Not as crucial for most fish, but some have needs, such as lots of hiding spots under wood or in caves or rock crevices. Some need wood. Some need plants (real or artificial).
Light. Most are forest fish from quite dimly-lit waters. Bright light can be highly stressful [more on stress momentarily]. Having the minimum light intensity for the aquarium [live plants sometimes determine this] is the first step, plus using floating plants, branches, etc.
Fish. Some need to be in groups (called shoaling fish), some need to be in pairs, some singly. This has to be considered when deciding on species because obviously the size of the aquarium will affect numbers. Many have specific behaviours that restrict tankmates; you cannot successfully combine active feisty fish like danio and most barbs with slow-swimming sedate fish like gourami or angelfish. Then there are behaviours; not all fish are well-mannered.
Last comment is on stress. All of the above factors, if not suited to the fish, cause stress. Stress in fish, as in humans, weakens the immune system. Result, the fish will be less healthy and more likely to get sick. And die prematurely. It is proven fact that reducing or eliminating stress is a guarantee to healthier fish. And that is much more rewarding and less stressful for the aquarist too.