Trunks used the Mafūba (Evil Containment Wave) to trap the immortal Zamasu.
However, in Dragon Ball we've always heard that Mafūba kills the "user".
Why didn't Trunks die?
According to the wiki, the move requires so much of the user's life force to perform that those who use it are likely to die soon afterward, despite the success of the technique. The drawbacks of the technique can be negated if one posses enough power to use it without dying.