Find the fundamental causes and effects. Technology will always be bound and based on conservation laws of matter and energy. Magic will make something from nothing at some step. No matter the level of complexity, you will find that matter and energy are manipulated sophisticatedly but never gained from nothing or lost to anything. Fundamentally, all can be accounted for in technologic devices. Magic is not of our universe other than as an idea of human minds. Magic would violate many laws of space, time, matter, and energy in order to exist. So, no matter the advancement, technology is innately distinguished from magic in that it is in the world (i.e. not just imagined) and that you can deduce it’s functions down to fundamental forms of matter and energy forces.
Note: Magic can be understood the same way as technology or anything real, really. To do so would require physical accounting, mostly rooted in sociocultural and biological psychology. That is, accounting for things in the realm of mental constructs and social beliefs; rather than thing in the realm of physical forces beyond the mind.