This might depend quite a lot on the field and on how much the individual professor has to say in your general admission to the program.
But, the best method is a personal visit and directly asking them. You will need to convince them, no matter how you proceed, that you have the correct background and good prospects for success. Your proposal, if you have one, needs to mesh well with their interests. Or you might need to be flexible enough to fit into one of their projects rather than your own.
But face to face is best if you can arrange it. Professors get a lot of email from potential students who are just sending out broadcast appeals without being especially serious in any of them. You want to avoid getting lumped together with those. So, if you must do it by email, be sure that you express knowledge of what it is that they do and can say how you might fit into that in a productive way.