Use Sword and a mastercraft shield. Block worm's attack, then attack it twice and put your shield up quickly for worm's next attack. Rinse lather repeat. If you get knocked back too far the sword won't hit. Maintain push towards the worm to stay close while shielding. Practice the timing. When looking for them. Go on foot. They will find you. When u see a dust circle on ground in front, put your shield up for worm's surprise attack and jus keep up the pattern I mentioned. You can it twice after every block. That's how its done on foot.
On Ragnarok I had the 'best' surprise ever and encountered one not knowing what the heck was happening I was gathering meat from killing animals and noticed some dust following me I stayed to see what it was and a giant worm appeared and killed my pteranodon and me along with it
Interestingly if you come into an assumed view range of a Deathworm a bug, Pune not intended, allows the Deathworm to be seen for a brief second, allowing one to prepare against either attack or attacking the monster.