Watch some tutorials (and follow them recreating everything)
Now gun example that traces what it hit:https://youtube.com/watch?v=DTNO4kULts4
When you know all above you can make “gravity gun” from HL. Instead of just moving up or left objects make them physics enabled and apply force or impulse.
Inventory system is another can of worms, for now better focus on physics and blueprints. You kind of need to know blueprints communication to start with umg (ie user interface),
so best course is learning all that first while doing physics and basic gameplay. However make some very simple umg hud (but do not shoot for inventory yet).
Stuff you should know before going for inventory in umg:
casting, arrays, event dispathcers, blueprint interfaces,
Things that help and make cleaner code:
Macros, function library, data structs,