I need help with where to search or how to make those AI

i am making a game about sexual abuse and dangerous envoriment for women, and i have little to no experience with coding, so i was wondering if there is any manual or tutorial on how to make those AIs i have in mind:
one that stay’s still until the player passes through his vision field, than it follows the player at certain distance until both are in a place with less NPCs
one that keeps following the player the entire level but only chases and attacks in desert places
one that sees if the player is being chased and tries to help
and others more

This is a great thing, I think everyone feels this information is very valuable, thank you happy wheels