How to get a mentor or supervisor for PhD studies in Computer Science?
Apply to PhD programs in your area of interest.
Visit the schools that accept you into their programs.
During your visits, talk to professors about (a) whether they're taking students and (b) whether you share mutual interests.


You can also try emailing professors before you apply, to get a sense of whether their school/department/research group is a good fit.  But be warned that many will ignore your email unless you've already been admitted to their program.  (Expert tip: pay close attention to the warnings and admonitions posted on their personal home page!)

A much better way to make first contact is to attend conferences or workshops in your area of interest (and make a paper/poster presentation, if possible).  These events let you meet many potential advisors all in one place.  Plus, you get to hear about their work, and get a sense of their personality, hygiene, etc.


  I feel afraid of not having enough background.


You and me both, pal.  It's called impostor syndrome, and everyone* in academia has it.

Good luck!

*…except for the real jerk-Os.