When you purposely deny yourself something, especially in favor of the needs of others, you would describe this act as an abnegation. This has to be your choice, not the choice of others — so it's not abnegation when your parents don't let you stay out all night.
The noun abnegation definitely has the sense of self-denial and self-sacrifice. So you wouldn't use abnegation to refer to the fact that you are giving up candy in order to eat more fruit. Instead, you would use the word if you were giving up desserts in order to donate to charity all the money you saved by not eating them for a month or two. Some religions have fast days and you would definitely use abnegation if you've given up all food or something you like to eat in order to follow the rules and requirements of your beliefs.