Guides to species usually include this information, which should be among the criteria you use when selecting fish. It is easier to keep fish healthy if you choose a selection which like similar conditions. You can choose to specialise in one particular type of fish, or set up a community tank. The specialist route is relatively simple, so long as the fish are of a type that tend to shoal, rather than fight each other, or you just keep one. That interesting looking catfish that adds an exotic touch might come out at night and chomp on its sleeping neighbours' tails.
Tiger barbs are notorious for nipping bits out of their neighbours.
Zebra danios, in their pin-stripe suits, may be considered too ordinary by some fishkeepers, but, they are among the gentlemen of the fish world, and will not commit such crimes. Some fish are happy living a solitary existence, and do not bother other species, while others need to live in a shoal to thrive. Shoals can also be more entertaining, since the fish interact and dance with each other. Guppies, cheap and cheerful fish with tails like silk scarves, can be especially entertaining in their shoals. There are a few species which need more space than the average tank can offer, especially fast-mving large species that like to live in shoals.