The beginning of the Enchiridion discusses exactly this point and is one of the most foundational concepts of Stoicism. There are things in your control and there are things out of your control. If you desire things out of your control and you don't get them, you will be unhappy. If you avoid things that are out of your control and they happen to you, you will be unhappy.
Therefore, on the topic of happiness and contentedness, focus on those things which are in your control. The Stoics teach that practicing virtue (exercising courage, temperance, justice and wisdom) is in your control and will bring you contentment.