I have an assignment, I need to specify with examples, in which situation the mean is the best central measure and in which the median is (I also need mode but I know that).

I read that when having an outlier, the median is better, and it makes sense, if I check salaries of people and sample Bill Gates, I will get a huge mean. According to this logic, why and when should I use the mean ? Isn't it better to use the median all the time ? I mean, if there are no outliers, why using the mean ?