If you are talking about tank fish its easy to tell but if you are talking about game fish which is the only fish that matters. Females are always bigger than the males and length and depth. Because they are always carrying eggs inside them. Which makes good bait for the other fish. Also Female game fish are more colorful then the males and fight harder when hooked. Who cares about tank fish I don't. So bite me.
Color is a good way. Many species of male fish are bright & colorful. Females much duller, often shades of brown or beige. Also, their "bottom" parts are a little different looking, aka. their cloacal areas. You will need a detailed biology book to compare the differences.
Take it out of the tank and put it in a glass cup. This normally magnifies the fish. Look closely at the tail and the eyes. If it looks like it has two tails only one is more under the fish and smaller and there is wrinkles on its forehead its a boy. If it has a small crease on its under belly and bags under its eyes its a girl. If it is plump and has dark bags under its eyes and swims slow because its fins are swollen.... Your fish is pregnant.
wiggle your finger in the water next to the fish ! pay close attention to what it does ! If he swims away then it is a boy , but if she swims away from your finger then it is a girl ! you may have to repeat this a few times to be sure .....