How do I access Actor's actor components from AIController?

I am using c++ code and i am wondering how I access an actor component which is a part of an Enemy. I want the AIcontroller class to have access to the actor component.

You can access the enemy controlled by your AIController by using GetPawn() in your AIController.

Don’t forget to cast it to the actor type you are using if you do that you can get all the variables etc the pawn has.

Thanks for your answers! Can you show me how to do this?