how to use saved playerprefs value from one script to other script

i have a script for adding gold and i have to purchase accessories using that gold,for that i have to use saved playerprefs value in gold script to buyaccessories script. if(gold.store >= 10) here gold is script variable name and store has the last added gold value.i have to set the limit for gold too like if the gold amount is zero i cant buy any of accessories and gold amount should not go below zero.if this condition is true i can buy particular accessories. even if gold amount is below 10 or zero the button interactable should be off through script

Try this. First create a script. No need to attach to any object. It just a script that will store your gold. Name the script “PlayerPrefsManager” or whatever name you want, but I like to name it PlayerPrefsManager. Write the code in the script as follow

const string GOLD_STORE_KEY = "gold_store"; //name whatever you want

	public static void SetGoldStoreKey (int gold)
	{
		
			PlayerPrefs.SetInt (GOLD_STORE_KEY, gold);
	                // store your gold in the PlayerPrefs
	}

	public static int GetGoldStoreKey ()
	{
		return PlayerPrefs.GetInt (GOLD_STORE_KEY);
                // get your stored gold to buy accessories 
	}

Show me your gold script and your accessories script so I can help you set it up.