Depends if you are talking about the content of the variable or the type of the variable.
== Type ==
For the type, is this variable Words a FString, TArray, int32, etc… most popular IDE’s have something to find the declaration. I use Rider (for Unreal Engine) and I can hit “Ctrl - B” and it will go to the declaration or usages. I think Visual Studio might have something similar.
== Content ==
If you mean what content or theoretical content is this variable holding at any given time, that is a little more complex. Using a debugger is one way to see what content is stored at any given time and most popular IDE’s can do it (Debug Unreal Engine Project | JetBrains Rider), but this takes a little setup work. Another method is printing out information to a console or log (UE_LOG for instance) to display at certain points in the code to verify the code is doing what you think. Something like:
for(int32 i = 0; i < Words.Num(); i++)
{
UE_LOG(LogTemp, Log, TEXT("i (%i)"), i, *Words[i]);
// do something with words...
}
int32 RandWord = FMath::RandRange(0, Words.Num() - 1);
CurrentWord = Words[RandWord];
UE_LOG(LogTemp, Log, TEXT("Current Word: %s"), *CurrentWord);
== Notes ==
It is typical for a programmer to have to keep some sort of mental model of what is going on. This is what makes naming variables very important. Too long or too complex, then it may be easy to forget. Too short, then it may be difficult to determine what it is.
However things like keeping functions short and purposeful and making code easily readable helps for anyone after you or for yourself years later. However, too short of a function may affect performance if data is passed around a lot needlessly. It is a balancing act of sorts.
Also this is where Unit Tests help as well. Unit Tests validate the functions you write in small chunks so you can be sure each function does what you expect.
Hope that helps.