How do I make an animation Unity?

I was wondering how to make an animation on Unity.
Do you first make it on a different software or on Unity?

Both are possible.

In general, the better solution is to make the animation in another program and import it in. This is especially true for complex animations. However, simple animations, like a door opening and closing, are perfectly fine to do in Unity with the built-in animation editor.