All perfect praise be to Allaah, The Lord of the Worlds. I testify that there is none worthy of worship except Allaah, and that Muhammad is His slave and Messenger.
First of all, you should know that it is very rare to find only benefit without harm in any single thing; it is for this reason that the Sharee’ah (Islamic law) balances between the benefits and harms and then a ruling is made according to what is most prevalent in it. So, if the benefit of something outweighs its harm, then it is permissible. An example of this is Jihaad (fighting in the cause of Allaah). Jihaad is permissible despite the hardship and harm that it involves, and that it subjects to killing. It is for this reason that Allaah says (what means): {Fighting has been enjoined upon you while it is hateful to you. But perhaps you hate a thing and it is good for you; and perhaps you love a thing and it is bad for you. And Allaah knows, while you know not.}[Quran 2:216]
The opposite is true if the harm of something outweighs the benefit; it is forbidden. An example of this is the saying of Allaah about wine and gambling (which means): {They ask you about wine and gambling. Say, “In them is great sin and [yet, some] benefit for people. But their sin is greater than their benefit.”}[Quran 2:219] It is for this reason that the Sharee’ah has forbidden such things.
A group of scholars have clarified these principles, like Al-'Izz ibn 'Abdus-Salaam, Ibn Taymiyyah, Ibn Al-Qayyim, and Ash-Shaatibi all. They are principles that a Muslim needs in order to know the Sharee'ah ruling on unprecedented issues, including the issue of trans fat. There is no doubt that they are good and contain benefits, while their harm is endurable. In addition, the harm may only affect those who consume too much of them but they do not harm the person who consumes only a reasonable amount.
There is no doubt that a Muslim eating what he or his family cooks (as they are more conscious of what is beneficial) is better for him than eating elsewhere like restaurants and the like, for many reasons like cleanliness and so forth. Nevertheless, it is permissible for you to eat from restaurants as long as you eat lawful food and abide by the limits of Sharee'ah.
Also, you are not obliged to prevent your children from consuming sweets that contain such fats, but it is better to make similar sweets at home that are free from those fats.
Allaah Knows best.