I am looking towards getting into a good PhD program in Germany. How can I convince any professor to take me as a student?
I work in computer science, but I think it doesn't matter in this case.

Please don't think it's a stretch to say that, but how do you achieve attention of someone on an online dating site? That's right: by standing out. As a professor, I get occassional emails from prospective students. They differ a lot in terms of content, language and attitude, so they make very different impressions on me.

There is no, and there can be no universal rule: people are different, and it is not possible to give a recipe that works for everyone. Some professors are simply not interested in getting new students (it's a "load"), and thus won't reply positively regardless of the quality of your mail.

For me, "a request, a CV, and a transcript" looks like something that you send in bulk, to dozens of people. Why should I react? Basically, I treat any bulk mail as spam. Yes, I get it: as a student you might simply want to enter a certain resonable university and study a certain field you want to work in. But what should be my (professor's) motivation to support this endeavor of yours? It is a commitment both for you and for me.

What works for me is when people are genuinely interested in my research project, and they wish to support it, so they will be not just a burden, but my assistants. Fake interest ("I am very impressed by your work and want to be your student") is easy to spot, BTW. I have no interest in studying random people's CVs and transcripts; if I wished to do it, I would work in HR.

Bottom line: connect what you already studied with something that you want to study, think how to present your previous experience and obtained knowledge as a valuable asset for the prospective professor's lab. Find a person who does something that you genuinely like. Read his/her research papers (i.e., do your homework), try to propose a possible direction for your studies. Try to be a collaborator, not a burden.

I must also say that things become more complicated when you need more than just "an approval". If people just wish to come and join our lab, it's different from asking to fight together for their scholarship, for example.