I think I understand what you mean. Instead of creating a variable then using GetComponent you want to access it directly. Unity won’t let you do that with certain components (mostly custom ones). There are some components Unity caches for you automatically.
Usually these are the most commonly used ones. For the Light you could use it directly, although Unity sometimes goes back and forth on which components can be used this way.
So hence why you may see Rigidbody using GetComponent and sometimes it’s not used. With Light it’s the same way and things like Transform.
For anything custom, like a script you wrote you’ll need to use GetComponent as Unity doesn’t know what that script contains. Using GetComponent regardless won’t do any harm if it’s in the Start function as you’re telling Unity that you want to cache it once within the start of that function rather than having Unity do it.