Although this distinction may not be strictly followed in usage, избавиться от has a connotation of permanence and profundity, while отделаться от is rather temporary and situational.
It's possible отделаться от without избавиться от.
отделаться is translated as to shrug off, to shake off
избавиться is a cognate of избавление - salvation, deliverence, so when one избавляется one salvages/extricates oneself, which is usually construed as having lasting effect.
That which one избавляется от exerts greater influence on or power over them.
In a collocation such as избавиться от болезни/привычки/проблемы/иллюзий/(any personal quality) it can't be replaced with отделаться.
Secondary derived meaning of избавиться от as applied to animates is to kill and as applied to inanimates is to dispose of. Отделаться doesn't have such connotations.
In Russian - English dictionaries both verbs have virtually identical translations.
In the dictionary Бабенко Л.Г. — «Толковый словарь русских глаголов. Идеографическое описание Английские эквиваленты. Синонимы. Антонимы» on p. 234 (and in other Russian - Russian dictionaries) both are listed as synonyms of each other, yet the examples for избавляться specifially, in my view, point at a permanence of the result
Чтобы спасти себя и весь отряд, нужно было быстрее избавляться от
предателя.
Она как-будто хочет избавиться от отцовской кабалы.