I don't know about the best way, but I did it very gradually and it worked really well - DS never 'asked' for it afterwards and I don't think he was 'traumatised' by the change, ifkwim. I started by introducint EBM in a bottle from about 5 months old, one bottle a day, and it took some time and effort for him to accept the bottle but I never let him cry over it. I'd just offer the bottle, let him play with it, and eventually he figured it out (at first, he'd blow in the bottle, bite it, push it, play with it). Then I increased to two bottles a day (during day feeds, first at lunchtime, then the PM feed). And gradually I introduced formula, which he took really well, and I gradually stopped the night feeds (I gave him a bottle a water instead of milk at night, and it worked OK, but he did cry a couple of times over not having his milk). The last time I BF him was about two months after the process began, and it was on a flight back from Canada. I never offered it to him after, and he never 'asked' for it either. Anyway, I was pregnant so I had to stop!
I know it's not the easiest method, or the shortest, and some people go 'cold turkey'. One point I should mention is that I never really BF him 'on demand' except in the very early days, he settled in a flexible 'routine' so it was easy for me to decide which feeds will be bottle and which ones will be BF.