adverb (accusative neuter singular of yathāsukha, functioning as adverbial accusative)
Analysis. yathā (as, according to) + sukhaṁ (pleasure, ease, comfort, accusative of sukha). A compound adverbial phrase meaning 'according to ease/comfort' or 'in the manner of pleasure'.
Etymology. yathā is from √yath 'to go, proceed, be fitting'; sukhaṁ is from sukha 'comfort, ease', cognate with Sanskrit sukha and likely related to a root meaning 'to suit' or 'to be easy'. The whole phrase expresses the idea of acting according to one's comfort or pleasure.
Meanings from the Digital Pāḷi Dictionary; morphology and etymology by Claude.
Lite mode — plain HTML for e-readers and old browsers. Full version