Yes, first please note that alliteration is the repetition of same first consonant sounds occurring close together in a line such as in the second stanza of “Solitary Reaper” the ‘n’ sound, “No Nightingale” and ‘a’ sound in “Among Arabian” and ‘s’ sound in “silence of the seas” are good examples of alliteration. Assonance, on the other hand occurs when two or more words repeat the same vowel sound, though the words may start with different consonant sounds such as in the first stanza “Reaping and singing” both these words have similar vowel sound “ing” at the end of the words, however these start with different consonant sounds. Assonance also occurs by repetition of sound ‘i’ in the final stanza, “The music in my heart I bore.”
Have you got it? I have underlined the words using alliteration and assonance. You just need to do practice again and again on different poems, then you could easily differentiate.