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. You might also use the word if you are giving up dessert so that you can 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.