Changing sprite of a different object with a button

I am making a bestiary inventory system, and on the left there’s the item’s and on the right there’s the big item and description. I know how to change the text/description although the image is not changing. I tried it with sprites (SpriteRenderer) and it didn’t work, but I can’t figure out to test it out with images.

Create a reference to the Sprite

//The Image Component in the UI
public Image icon;
//The Sprite from your resources
public Sprite image;

and set it with

icon.sprite = image;

That should do it