The relationship between prejudice and discrimination on the one hand and ethnocentrism on the other is not one-way. While prejudice and discrimination can help to bring ethnocentrism about, ethnocentrism can also cause prejudice and discrimination.
Ethnocentrism is the attitude that our own ethnic group is superior to others. Naturally, such an attitude can lead to prejudice and discrimination. If you feel that your ethnic group is superior, you are going to look down on other groups. If you feel this way, you might also treat people from other groups badly. You might try to “put them in their place,” because you are sure that they need to be reminded that they are inferior to you.
But prejudice and discrimination can also lead to or reinforce ethnocentrism. For example, if you discriminate against people of other races or ethnic groups, you are not likely to ever be interacting with them on the basis of equality. They will, for example, have all the bad jobs while people like you have all the good jobs. This will increase your feeling of superiority. Of course, the more you feel like you are good and they are bad (the more prejudiced you are), the more you will feel superior to them.
Thus, there is a two-way causal connection between prejudice and discrimination on the one hand and ethnocentrism on the other.