As you can see in this answer, both "fregarsene" and "andarsene" fall into a class of Italian verbs called "verbi pronominali". These are verbs that change in meaning when they are accompanied by some clitic pronouns. In particular, as explained in Vivit website, the meaning of these two verbs is:
- fregarsene = non avere interesse per qualcosa (to have any interest in something)
- andarsene = andare via da un posto (to go away from one place)
Note that it's the presence of both pronouns, "si" (as you said in a comment, in the form "se" because it is in front of another pronoun) and "ne" which modifies the meaning of the verb. Anyway, particle "ne" in the sentence "Chi se ne frega" can be understood as "di questo" (about this), whereas in "... e lui se ne va" would be "da qui", "da questo posto" (from here, from this place).