Difference between /æ/ and /ɛ/
Solution 1:
Not all English speakers use the same pronunciations. Unfortunately, English has pretty weird vowels so it's hard to give good advice about how to differentiate them for non-native speakers. Some English vowels are differentiated to some degree by duration or the trajectory of the vowel through "vowel space" (e.g. for me, /e/ (as in aid) and /ɪ/ (as in id) are fairly close if you plot them on a vowel chart, but /ɪ/ is shorter and has a different trajectory).
It should generally be true that /æ/ has a more open quality than /ɛ/. It also tends to be a relatively long vowel, so it seems plausible to me that it is usually longer than /ɛ/.
If you are used to listening to American English speakers, a separate complication is the existence of "raised" allophones of /æ/ that may be even closer in quality than /ɛ/ (a raised allophone of /æ/ may actually be near /e/ in quality—a somewhat common transcription is [eə], which represents a single diphthongal nucleus, not a sequence of two vowels in hiatus). The exact distribution of this raised allophone of /æ/ varies between speakers, but it's generally conditioned by the identity of the following consonant. It's common to hear it before nasal consonants.
So in the particular case of ten and tan, the latter word might very well have a closer vowel than the first for many American English speakers.