How to make a patrolling enemy for a Side Scroller

I don’t know much about ai or enemy creation. Also, I assume that it would be different for a Side Scroller game because they can only walk back and forth. Is there a good tutorial that is out there that I should use? Or can someone give me the basic rundown of what needs to be done. Thanks!

P.S. This is not a 2D game it is a 3D side scroller