In this post you will learn the right way to spawn a widget in blueprint. I want to clarify that this is a generic example, we’ll spawn the widget in the level blueprint so that when you play your game you will immediatly see the spawned widget, except for that you could spawn it when you want and the way you want.
First step, open up your Level Blueprint by going to the Blueprints button in the toolbar above your viewport

then click Open Level Blueprint

as said, we will use the Event Begin Play that will be called immediatly after you play the game

to this event connect the Create Widget node

Click the Select Class and choose the menu that you want to spawn, in this example we will spawn the WBP_Sample

now assign the Return Value to a Variable of the same type

now your widget is created in memory but is still not visible in the viewport, to show it in your screen you need to call the node Add To Viewport

now that is visible you finally need to assign user inputs to this widget, to do that you need to call from your Player Controller, Set Input Mode UI Only

now if you hit Play you should see the Sample menu and you should be able to interact with it.
