When they are young: you have to check their genitalia. The male fish will have a small little cock. And the female will have a little hole.
But as they grow old the male fish will grow beard and a moustache, but the female will not!