In c++ how do I get a component from another class from my player character

Hey there, this code finds all TextRenderComponents on an Actor and prints the Text value. This will work regardless of the TextRenderComponent being placed in C++ or BP