To give you an example: if you have little personal contact to a specific minority, and over 50% of the people of that minority you see on TV are either criminals on local news, or musicians and actors playing gangsters, everyone who doesn't have a lot of contact with them in real life is getting scared every time they see someone who fits the profile.
It's up to the majority to give the minorities opportunities to present themselves in the best light, but you can't force someone to be not racist. Even those who don't want to be have an unconscious bias. You need frequent positive impressions of that minority to get a good overall impression and avoid that bias.
By the way, this is not limited to race, but also for example applies to people with tattoos. If all tattooed people you see are criminals, you are scared by tattooed people as well. It works with every property of people that's easily visible.