Marine fish it's hard to tell 100% for sure, hense one reason why most are hard to breed in aquariums. In some species, the female is usually larger than the male, or the most dominate ( if kept in groups) is the female.
In most cases as well, since it is hard to tell sex, its best to keep only one of most species, due to same species same sex = lots of fighting.