Like Orkney said, use “GetHitResultUnderCursorByChannel”.
On the PlayerController, listen to the mouse click.
When the player clicks, use a “GetHitResultUnderCursorByChannel” node and break its hit result. You will have access to the “HitActor” reference of this hit result. You can simply print the Name of the actor hit afterwards (or use it however you want).
Make sure you have every collision stuff set up to work properly (basically the hit actor should block the collision channel used by your “GetHitResultUnderCursorByChannel” node).