Custom Cursor hidden behind my UI

As the title suggests, I have made a custom cursor by making a new gameobject into worldspace and make it follow the mouse cursor. It contains transform, a script and sprite renderer.
That worked perfectly fine, the problem is, I have set up a few UI for my game and everytime I open them up, my cursor goes behind the UI. I get that this is because it is a gameobject and it will always go behind the canvas no matter the layer. Is there a way to fix this?
I also want my cursor to be interactable with the UI.


You can change canvas settings like so; How do you place a GameObject in front of a ui? - Questions & Answers - Unity Discussions
or instead of creating a game object that follows the cursor, you can just set the cursor to that image, if there isn’t anything else. HOW TO CUSTOMIZE YOUR MOUSE CURSOR - UNITY TUTORIAL - YouTube

Changing the cursor to the image wouldn’t work.
However is there a video on how to go by the first solution. I am kind of new to unity so I don’t know how to go about doing “2nd you can make your canvas to screen space in canvas, and put an object child in front of it.” this. Thanks.