When you create component, function that create it usually return pointer to component, you set it to variable in you class and then you can reuse it. All existing classes that have components set it usually store them in variables. , so for those check API refrence.
if not you can still get any component from this:
keep in mind this is expensive function use it only once to get the pointer
In Blueprint, you can drag and drop a component directly from the components list into the window to “get” that component for use. I am trying to do the same thing in C++ but I am at a loss for how I would do that.