There are several State Machine tutorials in the tutorial forum which will make you an expert.
Here is one example: