How can a custom audio file (m4a format) be set as my alarm tone on an iPhone? I am using an iPhone 8 running iOS 12.3.
First you'll need to add the audio file as a custom ringtone to your iPhone. For doing so, follow the instructions in the linked answer:
Once you have the custom ringtone into your iPhone (you can check the same by going to Settings app → Sounds & Haptics → Ringtone), you can also use it as an alarm tone in Clock app.