How to make simple AI?

This for some might be asking a lot, but I’m making an fps game and all I have left to do is the ai. The problem is is that I don’t know how to make them have any intelligence. If someone could help me, and maybe provide me with a script, all I want is where there is a trigger in front of the enemy and if my guy walks through it than the enemy will attack, and they only shoot, and the health needs to be in there too. Sombody please help.

There are many tutorials for this on YouTube.

What you want to use is OnTriggerEnter() and then inside that function, figure a way to make it so that the enemy will transform towards the target along Vector3. The target can be simply defined with a variable at the top of the script.