If you post a code snippet, ALWAYS USE CODE TAGS:
How to use code tags: https://discussions.unity.com/t/481379
You can’t “make” a RawImage into a 3D object.
You can assign a Texture to a Material and assign that to a MeshRenderer of a 3D object.
First, make a 3D object so you can map Texture2Ds onto Materials and put it on the MeshRenderer.
Once you have that up, you need a reference to the MeshRenderer to change out its Material. And you need a reference to the Material to change out the Texture.
ALL of the words I use above can give you very useful documentation pages in the Unity3D context. Go forth and search and learn!