I asked a friend how they were doing and they replied "元気でやってるよ". What is the meaning of でやってる? Is this some variation on である (to be) or is it a form of やる (to do)? If it is the latter, why does it use 元気"で" and not 元気"に"?
で can be used to describe how an action is performed. E.g. 「笑顔で手を振る」(Waving with a smiling face). やる is just "to do", as in "doing well". The action here is "doing" (やる) and it is modified with "~well" (元気).
Both に and で are case-marking particles (格助詞). 元気 can be a noun or an adjective: https://en.wiktionary.org/wiki/%E5%85%83%E6%B0%97.
Similar questions in Japanese: