Access a class on another script?

Hey guys I bump up a problem and I couldnt find an awnswer to ir anywhere so here I am asking for a little help.

So basically I have two scripts, on one I have a class, and on the other I want to create a fuction that will return type of that class of the other script, I’ve tried many different ways with no luck. I dont know if this is even possible but I apreciatte any help I could get, thank you in advance.

Script 1:

    //Inventory.cs

public class Inventario : MonoBehaviour {

	public class SlotInv {

		public int[] ItemIndex;
		public int[] ItemAmount;
    }

        public SlotInv Slot; //Testing
}

As you can see, here I have my class, and I made a variable from that so I could try to access the class from the other script, with no luck (through my logic)

Script 2:

//RecipeDataBase.cs

public class RecipeDataBase: MonoBehaviour {

   public Inventory RecipeItems;

	void Start () {
	
		RecipeItems= transform.GetComponent<Inventory> ().Slot;
	}

        //Here's what I want to do (it's wrong but you can get the idea of what I'm trying to achieve)
	public RecipeItems ReturnFinalItemIndex (int finalItemIndex) {

		return 0;
	}
}

This is just one of the many tries I made, this is just to illustrate what I want, so if anyone could help that would be awesome, or just say that is impossible to do. Thank You!

EDITED to give more info

I personally would use a generic list but you can use primitive array…Change to :

Debug.Log(ReturnFinalItemIndex(2));

public int ReturnFinalItemIndex (int finalItemIndex) 
{
       //Code for RecipeItems.ItemIndex or RecipeItems.ItemAmount;
    
  return finalItemIndex;
}