How would i make ai listen to the player?

so how would i be able to make ai listen to player commands?