If that’s the exact code you’re using, then first, you need to make your class public, then mark it with the [Serializable] attribute, and finally, declare it as a variable in a MonoBehavior:
[Serializable]
public class MyClass {
public TextMeshProUGUI textMeshProUGUI
}
public class SomeMonoBehaviour : MonoBehavior {
public MyClass myClass;
}