Hello To do something by yourself is to do it alone with no assistance. To do something for yourself is to do it with your own interests in mind. For your example.
New words, one handy idiom, and a 2-minute quiz — delivered to your inbox to keep your streak alive.