This is a movie with a black man as a protagonist. I believe it was a British movie. He had to excercise and do things to earn credits, and at some point he used most of his credits to go on a talent show. Whenever he ate something he wasted credits, until he found a trick on this one machine to get free apples (or some other food).
It’s from a British anthology TV series called Black Mirror, series 1 episode 2, “Fifteen Million Merits”.
Here’s a link to the episode:
https://www.youtube.com/watch?v=zYPbZNTbnko
Hope I’ve helped.