Just a quick follow-up to @FJCC's solution to clarify the how the code you wrote is processed, Sameera.
Here, the fill argument is ignored because ggplot() can only be made aware of the Sex column if it appears within the aes() function (which is where @FJCC's suggestion comes from):
However, the fill argument can appear outside of the aes() function as long as it is assigned a vector of colors, for example like this:
ggplot() +
geom_bar(aes(0:1), fill = c("red","green"))
The aes() function is used to translate column data (in this case sex) into visual information (color), but if you supply the visual information directly, you don't need to place the corresponding argument inside of aes().