Creating a simple AI for an enemy NPC

I’m doing a 2D platform game (think Super Mario) and I need to make an AI that can control my NPCs. It would be quite boring if nothing ever attacked you after all.
However, I have absolutely no idea how to do something like that, I don’t know first thing about AI. However what I need is guing to be quite simple so if I could just get some tips to get me started I think I can make it work.