Independently or alone
अकेले
English Usage: He prefers to work by himself.
Hindi Usage: वह अकेले काम करना पसंद करता है।
In the company of (indicating a surrounding situation)
के द्वारा
English Usage: The book was written by himself.
Hindi Usage: यह किताब उसके द्वारा लिखी गई थी।
Reflexive form of 'he'
स्वयं
English Usage: He made the decision by himself.
Hindi Usage: उसने स्वयं निर्णय लिया।