I couldn't sleep on planes my entire life until one year I did Europe-Korea 8 times and it became so routine it started working.
The routine part, I think, is what took the "I won't sleep on this long flight" anxiety away somehow, because I started learning the rhythm of the flight. For example, there is no point to try and sleep until the initial meal is served, you'll just get woken up anyway. So now I just spend that time thinking and daydreaming and being bored, then I quietly eat my meal but stop at feeling overly fully, and by the time it's over I start to get tired.
I also realized that a sleeping mask is a great aid for me (on the other hand, I don't need earplugs/earphones). This came as a great surprise, as I don't typically need darkness to sleep well, but something about the sensory deprivation in the plane setting seems to do the trick.
What I'm saying is, I used to describe myself as the "I don't sleep on planes" guy for a good decade, but then it started working; don't give up yet.
BTW, to give this a software dimension: I was recently on a flight with an airline I hadn't used before, and I really liked a UI in their in-flight infotainment that showed the entire flight as a timeline with all meaningful events penciled in (when the meals are, etc.) and a recommendation during which blocks to sleep. That was really nice and thoughtful.