Is it different between “buy something” and “buy yourself something”?
Yes, the "yourself" has been added here to express the meaning of purchasing something for oneself and not another person. Thus, we can understand "buy yourself something" to be a bit more specific about who the receiver is, than just stating "buy something." You can also use "herself/himself/myself" in similar ways. Ex: Buy yourself something nice for your birthday. Ex: I'm going to buy myself a nice coat for winter.