This video will show you several ways to animate an object using the Animator as well as a script. Both are valid in terms of animating objects in Unity, and you just have to decide which workflow works best for you!
Right-click 'Download' and select 'Save Link As' if the file opens in a new tab.