How exactly would I use implementable events in a line trace?

So I have a line trace to interact with actors in the world. I currently use a lot of if statements to see if the actor hit is an actor I can interact with and perform several functions. Can someone tell me what is the way to do something like this:

if (TraceData.GetActor()->ImplementsEvent()) {
    TraceData.GetActor()->DoImplementedEvent();
};

I’m sorry for the dumb question but the docs don’t explain anything well.