It is best to wash the hair the night before dying it so that the color shines through. Hair that is either too dirty or too clean can alter the color when applying the dye.
According to the beauty site Allure, it is best to get a trim before dying the hair. The reason for this is that uncut hair is likely to have split ends, and dying hair, particularly highlights, can exacerbate the problem. If going to the salon to get hair dyed, it is best to style the hair normally so that colorist can get a sense of the customer's usual style.