Standard Stoic fare here, with some confonting examples.
If you would have your children and your wife and your friends to live forever, you are silly; for you would have the things which are not in your power to be in your power, and the things which belong to others to be yours. So if you would have your slave to be free from faults, you are a fool; for you would have badness not to be badness, but something else.
Coming to terms with the impermanence of the things, and people, you love is a major theme in Stoicism. Although not articulated here, this is not just about preparing yourself for inevitable loss, it is also about appeciating what you have while you have it.
But if you would wish not to fail in your desires, you are able to do that. Practice then this which you are able to do.
Deceptively simple advice: practice only the the things which you are able to acheive.
He is the master of every man who has the power over the things which another person wishes or does not wish, the power to confer them on him or take them away.
A simple lesson in power dynamics: if someone controls something that you want (say, a job) or do not want (say, imprisionment), then they control you.
Whoever then wishes to be free, let him neither wish for anything nor avoid anything which depends on others: if he does not observe this rule, be hust me a slave.
And the solution to that conundrum? If you wish to be free, train yourself to neither want nor want to avoid anything that is in control of others.