I think you are missing part of the concept of how it works.
Casting is not to get a reference to something. A lot of people think ‘I need to cast to the player’, for instance. Wrong.
Casting is to ‘unwrap’ something, to find out it it’s the right type. Or, to convert to the right type.
So, for the player, you would do ‘get player character’ and cast it to your sort of player.
What are you trying to cast to?