How to destroy UMG widget?

SOLUTION
I’m using UE 5.4
What I did is add the widget and then store it on a variable and then I use this code to remove it.

Does not seem to work. The widget will continue to exist and execute code even after this is done. Which is very cursed.