Flowers are brightly coloured to attract agents such as bees or humming birds so that pollination can take place. Fruit is brightly coloured to attract animals to eat it so that the plant's seeds will then be spread around and new plants will grow.
Animals are brightly coloured for different reasons: a. To blend in with their surroundings. (Some animals are dark coloured instead for the same purpose, though.) b. To attract a mate. (Usually the males are more brightly coloured, which is unfair.) c. To attract their prey.
Ladybugs are brightly coloured to warn off would-be predators. Colour combinations such as red, yellow and black in nature serve as a warning to birds and other creatures that they are not good to eat.