  We report our investigation of the electronic and magnetic excitations of
Sr$_3$NiIrO$_6$ by resonant inelastic x-ray scattering at the Ir L$_3$ edge.
The intra-$t_{2g}$ electronic transitions are analyzed using an atomic model,
including spin-orbit coupling and trigonal distortion of the IrO$_6$
octahedron, confronted to {\it ab initio} quantum chemistry calculations. The
Ir spin-orbital entanglement is quantified and its implication on the magnetic
properties, in particular in inducing highly anisotropic magnetic interactions,
is highlighted. These are included in the spin-wave model proposed to account
for the dispersionless magnetic excitation that we observe at 90 meV. By
counterbalancing the strong Ni$^{2+}$ easy-plane anisotropy that manifests
itself at high temperature, the anisotropy of the interactions finally leads to
the remarkable easy-axis magnetism reported in this material at low
temperature.
