Determining the six of a turtle or tortoise can actually be tricky, especially when you first bring one home. Often the pets sold at pet stores are young. They're only a few years old. And so their secondary sexual characteristics are not manifesting. In sexually mature turtles and tortoises, there are some things that can help differentiate the sexes.
One would be a depression or concavity on the lower shell, the bottom shell, of male tortoises of some species. It is believed that that depression in the bottom shell of the males is used to aid during mating. In water turtles, especially some of our native water turtles here in North America, like the redeared slider here. When they're sexually mature, the males will actually have very long nails on their front feet. Again, it is thought that these are used in mating.
You can see it in our female here. Her nails are very short. It's typical for this species. Also, in redeared sliders the females grow to be much larger than the males, and this is typical in some species, although in other species the males can be larger than the females.
Another way you can differentiate the male from the female is males often have a longer and a wider tail. Also, the vent or the opening into the cloaca is farther out toward the tip of the tail in the males. So you may or may not be able to tell the sex of your turtle or tortoise easily. Again, it's going to depend on the species and their age.