If you would like to play .avi files with QuickTime Player (the default media player on Mac computers), you will need to download some video compression codecs. These codecs will convert the video's default format to one that is compatible with QuickTime Player.
VLC Media Player
Another alternative is to use VLC Media Player. VLC has the capability to play videos in almost any format, without having to download codecs.
You can download VLC media player here. Once installed, right click on your .avi file and select Open with > VLC.