What is the difference between chan and san and sempai?
San title of respect typically used between equals of any age.
Chan it expresses that the speaker finds a person endearing. It comes from a "cute" pronouncing of -san (in Japanese, replacing s sounds with ch sounds is seen as cute). In general, chan is used for babies, young children, grandparents and teenagers.
Sempai is used to address or refer to one's senior colleagues (respected colleagues) in a school, dojo, or sports club. So at school, the students in higher grades than oneself are senpai.