What can a PhD student do when a professor is no longer interested in advising them? I am a first-year PhD student. After about  months into my program, my adviser has asked me to look for another lab. I have had no luck so far with other labs in my department. He told me as my background is not similar to his research work, I cannot succeed in this area. He told me to look for a lab which matches with my background and interest. I have funding for this semester but so far have no guarantees for the future. 

I have talked to the graduate adviser, and they said there are no options for departmental funding.

Given this situation, what could be my best option? I can’t even earn a master’s degree without funding, and from what I’ve heard, transferring to another university would be tough since they may not view my case favorably.
I would urge you to not lose hope and keep an open mind about your research interests. If your field is more applied than theoretical, it is very much possible to find advisers from other departments who might be doing the same flavour of work. Contact everyone you can! Talk to other students and see if any of their advisers has funding. 

As far as teaching assistantships go, often times departments take applications from students outside their own (this is true particularly for departments that get plenty of research money, example, some engineering ones). Don't hesitate to reach out to the staff in those departments!