Hi, sun622,
iMovie 9 has been discontinued and, in any event, will not work on OS 10.13.6. You need iMovie 10. If you ever had iMovie 10 on your Mac, even if you deleted it, You can go to the app store and download it from your purchases listed in your account. If you never had iMovie 10 on your Mac then you won’t be able to get it unless you can find it on a third party website.
You can use the free download, Handbrake, to convert the .avi files to a good quality Mp4/AAC that will work well in iMovie. Handbrake will do it by default.
You can get Handbrake here:
https://handbrake.fr/
A simple way to do it is to open Handbrake and do a File/Open Source. Navigate to your video and choose it as the source from the resulting screen. Then do File/Start Encoding. Wait a couple of minutes for the conversion to
complete. Then save and import the converted clip into iMovie.
-- Rich