Accessing a variable from a script not attached to a game object (c#)

I’ve been racking my brain for the longest time trying to find a way to access a variable on a script that isn’t attached to any game objects. Is there any way to access a variable off that script (without creating a new instance of that script) or do I need to attach it to a game object to access it?

I know how to access variables off scripts attached to game objects in the scene by finding or saving the game object and doing a “GetComponent”, but this method only works for scripts attached to game objects.

Either have an instance of the class or have a static member.