How can you tell someone they are being inappropriate?

First ask them to speak to you privately and then ask them why did they say the things that they said. If they continue ask for your supervisor or teachers advise on how to stop it.