Fish have fins to swim and stabilize in the water just like we humans use our feet to walk. they have gills that make them breath under water, and they have scales to be able to protect them selves from cuts.
Organisms, especially fish, have an advantage to hide from larger predators such as sharks. They can fit and hide easily because of the size and flat body. In reality, coral reefs have a lots of crevices. But clownfish may hide into its stingy tenants from sharks, not in crevices or cracks. In addition, small body allows them to make sharp turn at last second and escape from predators.
Most animals that live around or in coral reef have bright color just like coral reefs is colorful environment. This fact enables the animals to camouflage from predators. Furthermore, animals like sharks don't use their eyes and instead they use nose so those colorful fish can avoid being eaten. Some animals even have bold colors to make predators think that they are poisonous.