This term comes from the popular sitcom Parks and Recreation that ran from 2009 to 2015. Two of the characters celebrate a day each year where they treat themselves to nice things–food, clothes, etc. They justify it with the refrain “Treat Yo Self.”
So someone may eat an unhealthy food like a donut and then say afterwards, “Treat Yo Self.”
Or they may see expensive clothes in a store and be unsure if they should make the purchase before ultimately deciding to purchase them and saying, “You know what: treat yo self.”
Here is a clip from the show: https://www.youtube.com/watch?v=gSjM5B3QNlw