Don't suffer the illusion that if you are being very annoying, someone in the flat or house is going to tell you.
Unspoken resentments and grievances in a flatshare or houseshare can be its undoing.
Ideal flatmates raise niggles and grievances with perfect timing and measured emphasis. The rest of us deliver resentments that are way past their sell by date usually when a bit drunk and when there are guests in the house.
If you are really not happy about shaving foam on the bathroom basin then you need to find a way to say so. Preferably don't text it. Broaching this kind of stuff is not easy and its an accquired skill. Also there is much evidence that people who feel 'attacked' entrench their position automatically and don't change their behaviour. So try not to 'attack'. Try to 'encourage'.
Try to ask yourself what this is about for you. Is it about just this or are you thinking that this is merely an example of inconsiderate behaviour. If it is the latter then don't try and use this minor incident as an 'example'. You have to be more honest and say that there is an aspect of behaviour in general that is causing problems for you and WHY that is bugging you. This is usually because you feel disrespected by their actions (or inactions). And that is totally fine to feel that way. Be aware however that if the response is indifference, then that will confirm to you that you are indeed being very disrespected. And then you are going to have to do something about that.
'You know I saw that foam on the basin and for a moment I wondered what on earth it was. I guess you didn't notice it.'
If this doesn't work the next stage is not smearing their foam on the bedroom door OK ? It's a gradual process of communicating your discomfort.
Similarly, be sensitive to your flatmates' concerns. It is very OK to ask from time to time if you could be doing something better. Am I too noisy ? Does my Netflix bother you at night ? Are you OK with my friends coming over to the flat this weekend ??