A lot depends on what you need the dog for. A mobility support dog, like seeing eye dogs, has a pretty defined path. If you need them for other things, it really depends on what your needs are, and what amount of effort you are able to put in.
There are a lot of factors to consider. This is a complicated thing, and it's great that you're doing your research before you jump in. This is going to get long.
Let me introduce us. I have ankylosing spondilitis, lichen planus, fibromyalgia, neuropathy, depression and anxiety, topped off with various weather-wise aches and things from the general wear and tear of life. I'm also a type II diabetic. My dog is a now eight year old boxer named Cleo. She's a rescue I've had for almost four years. Without her, I would have a hard time safely living, would have a much harder time managing the disease, and would have to be insulin dependent because I couldn't safely take the medications.
I want to start by saying that I absolutely love my dog and everything about her (except maybe the way she hogs the bed at night and farts like a trucker if she gets too much in the way of people food - those things I love a little less). She makes my life better is so many ways. But a lot of this is going to read like a cautionary tale, because this is a large undertaking.
You need to think about them as a dog. You have to care for them while they're caring for you. All the advice given to people generally considering getting a dog is a good place to start. Having a dog itself is a giant responsibility, and it's not cheap. And it's not just money -- it's time and effort too. Think about feeding, walking and exercising, grooming and toilet needs, vet bills. And think about their whole lifetime. Large dogs live 10-15 years on average, and little dogs tend to live longer than that.
You need to figure out what the dog can help you with. That list someone else posted is a good start, but not inclusive. Do some googling with "service animal tasks (name of your issue)" and see what others have done.
Then think about the tasks you need done and the dog together. What kind of dog will fit into your living space and your life? Can a dog that fits your life do the tasks? A 90 pound lab in a studio apartment is hard on you and the dog. But some tasks like opening doors would be difficult or impossible for a little dog.
Let's take these two concepts together. For example, Cleo is a diabetic support dog. She's trained to detect the changes in my body that herald a low blood sugar and alert me by licking and nuzzling the inside of my right arm that she never touches any other time. If I don't follow the alert after 3 tries, she is trained to interrupt what I'm doing until she either sees me eat or sees me take my blood sugar with the machine (specifically, use the lancet). Preferably, eat. She can detect the changes before the machine can. When I say interrupt I mean that if I'm reading, she'll take my book. If I'm playing a game, she'll shut off the Xbox with her nose. If I'm on the computer, she'll keep nudging my hand off the mouse. When we're out, she carries the machine and information about my issues.
Training is a huge topic. There are no hard and fast rules on how to get a dog trained or certified. In my case, I got Cleo just as a regular dog and took her in for re-training due to some issues with her previous owners. Her trainer was the one who realized she could do the tasks and set me up with the resources I needed and helped me train her. You'll need to google around in your area for resources. Assistance Dogs International has a service that can help you find what's in your area.
Time is a big thing. Not just in "how long to train". Are you starting with a puppy? If so, they have to grow up. On top of training, their body (particularly their joints) needs to be fully mature and stable. And even if you're starting with an adult, it takes time to train them. And once they're done with classes, you'll still be working on this with them all the time their whole lives.
Even if you get a dog that's fully trained, you'll need training too, to interact with them while they're helping you and to maintain their training as you live together. You are partners in this and you have to do your part, too. Even if you are an experienced pet dog owner of working breeds, a service dog is a different kettle of fish. I grew up in rural Alaska, and we had sled dogs so I grew up around them my whole life and I still had a lot to learn.
It's not just the task training. They also have to behave like a service dog in public, which is more stringent than the usual obedience training, and can be more difficult than the actual tasks that help you. There are lots of guidelines, but this is a pretty good page of information, or just google "service dog public access standard".
And sometimes it doesn't pan out for a dog. The combination of brains, temperament, and physical ability is far from common. In the case of Cleo, a dog that can be obedient until suddenly they have to not be is extremely difficult. If I'm out of it, I'll tell her to quit it or maybe scold her, but she has to keep at it. So she has to have that right kind of keen nose, be trainable to very complex and abstract tasks, and have the ummmm... assertiveness to carry them out even in the face of my possible opposition.
They aren't perfect. They can misbehave. We tell the story of "The Accidental Chicken" at my house from when she was back in training and she nosed a wrapped chicken in the meat department (I bought it just because I didn't want anyone to feel upset). And there have been a couple times where other dogs have challenged her and she responded and she's not a little dog.
And it's not all perfect freedom. You can try to do things they can't handle. For example, I help out with PAX. Cleo is timid around young men due to things that happened before I got her, particularly if they have a beard or wear a hat. PAX is thousands of them in one place. She's learned to cope with the regular show halls. But the Expo Hall floor with it's noise and everything else is simply beyond her ability to handle. Even "official" mobility dogs with years of training their whole lives have problems with it. So we don't go to the Expo Hall.
And be prepared for a LOT more interaction with people when you go out. I was at the grocery store with my younger daughter once, and after the fourth or fifth person who came up to me to tell me their story about their dog and asking me what she does she said, "God, Mom! It's like you've got a unicorn on a string!" So we call it The Unicorn Effect.
It has great points. The difference in how people treat you is amazing. You get smiles instead of frowns or being ignored. People actively engage you. But it can be a challenge. I'm not exactly a social butterfly on even a good day. I know it's been good for me, but sometimes I just want to get the shopping done and crawl back under my desk, not answer 15 questions about how I got her and how she helps me and fend off several tribes of house-apes.
And be prepared for a few people who raise their nose and sniff as if your unicorn has been leaving little rainbow piles of glittery, suspiciously candy smelling unicorn shit all over. I've been told she can't be a service dog because of her breed, or yelled at. I had a gate attendant try to block me from getting on a connecting flight halfway through a trip because someone else's dog had previously acted up badly and she was soured on the entire thing.
You'll have to learn to answer challenges and educate people on the rules. It's not every day, but it's quite often. I've talked about that airline problem. That was only the worst of the issues we've had. I've had to switch airlines three times now because of their stupid rules and the way we fall through the cracks. We had such a bad experience at a frozen yogurt store once with an uneducated manager I had to get a hold of corporate and give the education materials so they could teach them.
And some people are scared of dogs or are allergic to them. I had a neighbor for a while that has just come here from North Africa, and she'd been attacked by a pack of feral dogs. I feel so badly when I run into that and try to be sensitive.
Claire mentioned traveling, and this is a whole 'nother ballgame. If you get a dog that's a brachycephalic breed, you can have trouble traveling due to airline regulations (boxers, bulldog, shi tzu, pug, etc). They don't do low air pressure well (in worst cases they will die). So the rules about how they fly are kind of dumb. Make sure they're small enough to fit under a seat. Cleo just barely fits. The airlines do the best they can, but twice now we've had to fit her under a center seat between my feet. And Cleo digs the car completely, so even a trip to the grocery store is a great adventure.
At any rate, there's a whole lot more to it than this. And everyone's experience is going to be as different as their own needs and the specific dog. But this is a start.