Load new scene on object click

I’m exploring other options but i’ll also ask here.

I’m trying to set up a simple script so when a UI pointer on the FPS controller moves over objects, text comes up and if clicked a new scene is loaded.
I tried a basic collider system where you enter the collider and click e, but it’s imprecise and wasn’t working.

Now i’m thinking a better option would be ray casting. So when the pointer moves over an item with a collider trigger and is clicked it will load the new scene. Problem is Ive never actually done ray casting and am having a really hard time coming up with a script to work here. It seems simple enough but I’m entry level C#. A lot of the previous answers to this question Ive found are outdated now.

So basically I just want a scrip so when the player goes up and looks at specific objects a text prompt comes up that says the objects name, and when you click it loads a new scene.
I’m working on my C# but right now I’m floundering and rely heavily on help so if you can help I would greatly appreciate it.

Try using raycast to detect that specific object

Confirm Detection using simple if condition , using object name or by using tag on object

if condition is true use a pop up that will get active using
popupname.SetActive(True);
use a button to load new/next scene
SceneManager.LoadScene(“SceneName”);
Hopefully it will work.