Afraid of becoming like my mentally ill roommates

I am not ableist and know mental illnesses are not contagious. However I do believe mindsets are and that you can become the sum of the people you spend most time with and seeing as how I live with them I have no choice. But I do not want to adopt their habits like not brushing teeth or bathing for days, depressing and pessimistic ways of thinking and scarcity mindset. How can I do that when I live with them and don’t want to be rude and standoffish. So far I’ve been resenting them for spending my time with them and I feel bad about it bc im trying to be nice but know I don’t want to be here even though they are nice girls just not people I aspire to be like or would chose to be friends with otherwise.