The given reaction is an SN2 reaction. In this reaction, CN− acts as a nucleophile and attacks the carbon atom to which Br is attached. CN− ion is an ambident nucleophile and can attack through both C and N atoms.
In this case, CN− attacks through the C-atom because in polar protic solvents (EtOH in this case), more electronegative atom site (Nitrogen atom) will be solvated to a greater extent via H-bonding and hence, C-atom is now available to attack n-Butyl bromide and produces n-Butyl cyanide.