Have the desired effect when you perform the magic act (2,3,5)
I believe the answer is:
do the trick
'have the desired effect when you' is the definition.
I don't know anything about this answer so I cannot judge whether this works.
'perform the magic act' is the wordplay.
'perform' becomes 'do' (both can mean complete an action).
'magic act' becomes 'trick' (trick is a kind of act. I am not sure about the 'magic' bit.).
'do'+'the'+'trick'='DO THE TRICK'
Can you help me to learn more?
(Other definitions for do the trick that I've seen before include "Achieve the required result" , "as a conjuror is expected to?" , "succeed" , "Work successfully" , "How to heckle magician" .)