Coconut has a very peculiar features like no other fruit/vegetable.With features like a hard, dark out shell with a soft white inner shell makes it special.
The outer shell is considered to be a person’s ego, anger and all the negative qualities that can be associated, whereas the inner layer as the pure and all the positive qualities. And hence by breaking a coconut, we assure in the name of god, that we will break through our negative qualities(ego) to get to a new pure person with all goodness.
Because its like a proof, when something is said and done in front of others we tend to follow it with more dedication. So when we break a coconut in front of god, we make a promise that we will leave our negative qualities behind and change to a better person.