Hello. So you're here because you want to learn how to do different accents? Well, I've got some good news and some bad news:
The Good News
You can learn to do accents.
The Bad News
...it's just a lot of work. A huge amount of work. Like, thousands of hours.
You'll absolutely need some form of recording equipment so you can record yourself speaking, and play back and listen to and analyse the mistakes.
Step One: Vowel and Consonant Sounds
The first thing you're going to need to think about when you start learning accents is how accents sound, on a purely linguistic level. Fortunately for us, the International Phonetic Alphabet, or IPA for short, exists. For examples of how these all sounds, check out this link.
Now, some people will say they've come up with better methods that mean you don't need to learn the (not very many) symbols and sounds of IPA. For that, I'd say it might work better for them, but there's a reason the IPA Source exists for opera singers. If you learn how to pronounce the various forms of sounds of the IPA, aside from anything else you'll learn how to recognise different sounds and pronunciations of different words, and start to wrap your mouth and throat around how you make different sounds.
Everything we're doing when we're modifying our accents bases around changing sounds. For example, think of the British English pronunciation of "doll".
We start with a hard "d", then transition into an "oh", and then an almost "ole" sound at the end. For a softer, less posh British English accent, we'd change the last part to drop the accenting created by the "e" sound, and flatten and soften the middle "oh". Finally, for something like a New York twang, we'd change the middle to more of an "ah" sound, widening the mouth at the edges, and lowering the tongue to flatten the sound further.
This sort of analysis of sound is the foundation of everything from a linguistic standpoint when learning new accents.
Step Two: The Music of Language
All accents have some form of default rhythm and melody to them. You could literally apply musical notation to how they sounds are made, devoid of any words. For practising this, I like to take common passages (things like nursery rhymes, or lines from plays), and run them without words until I can get something like the accent, without any phonetics.
The key things to watch for here are the movement between pitches, the hardening or softening of sounds, and the lengthening and shortening of each phonetic beat. In practising these, I tend to stick two two sounds, a strong "D", and a soft "ah". That way I don't have to think about what I'm "saying", and it gives your mouth something to do (because you'll still try and say the words you're working with), whilst creating a basic framework you can run over and over again to work on the music until it gets the correct rhythm and melody.
Step Three: Physicality and Emoting
Ah yes, back in the acting part of things. How you perform an accent (and this includes your own) is partly enabled by your physical and emotional state. You'll sound different when you're nervous, because you've less exact control over your vocal production, than when you're confident and engaged, as your mind races ahead and your mouth just has to articulate what you're thinking after the fact.
As a quick side note, the latter of those is why when you're reading storybooks to children, it helps to be reading several words ahead of what you're saying. That way your mind already has the words your mouth is going to have to pronounce readied, and you'll fumble them less.
Anyway, back on the subject, your physical and emotional state will affect your accent, and they'll also affect accents you're trying to do. How much of your vocal production is coming from diaphragmatic breathing thoracic breathing, how much you're moving your mouth, how steady the production of sound is all plays a part.
It's worth noting that accents will also have a part of this built in. For example, think of "annoying sorority girl" accent. That's going to have a confident, but whiny, nasal production of sound, all coming from thoracic breathing and with heavily emoting facial muscles. This all matters because the level of activity in your muscles (especially your face) will change the types of sound you're able to produce. For more on this aspect, I'd strongly suggest reading my post on how to change your voice, which covers this in more detail.
Step Four: Accurate Samples
The next thing you'll need is a solid database of accents to reference against. Fortunately, here you can use IDEA. Every single sample has people reading the same piece of text, which gives you an idea of how specific sounds are being produced. However, what I find even more helpful are the pieces of general speech at the end which give a flavour of the language being spoken more naturally.
It's also where YouTube comes in helpful. For example, I've been working of late on a specific New Zealand dialect. For that, I've been referencing pieces like this:
For example, listen to 1:25 to 1:30 - the pronunciation of "message". That first "e" sound is almost an "i". Also listen to how the world "present" is pronounced at 1:36; it's almost like the British word prism. The "t" at the end isn't said, instead terminating at the n, with a nasal stop. The next two words, "What was", become "wowaz".
For the musicality, listen to 1:45 to 1:50. Focus on the "who we are and where we're from". There's a very specific form of melody to the word "from", starting high and dropping down a notch. It's something that turns up repeatedly in the New Zealand dialects. You can hear it again in the word "land" at 1:56, and "arise" at 2:00 (although with a lilt up to the higher pitch from the "ar" into "rise"). You can hear a variant on the end of line melody too - listen to 2:50 to 3:00. "...anything in the tank boys;" - the word "boys" comes before a pause in the sentence, but not the end of it. It's got a distinctive lilt up, which is characteristic of a pause before another sentence in the New Zealand accent.
It's this sort of breakdown of music and stresses and lilts and softenings and pronunciation of combinations of sounds that form the mechanics of what you're doing.
Step Five: Practice
My long suffering wife has to put up with me doing silly voices all the time. Whether that's running an entire game of Trivial Pursuit with her family in an Aberdeenshire accent, or the mid-Welsh accent I grew up with from my grandparents at home, or playing with pitch and tone, there's not a day goes by where she isn't subjected to some sort of vocal nonsense. And I'm still very much learning.
The point is, if you're going to get good at this, it needs to be like anything else physical you want to become adept at: constant practice. Every day, whether you feel like it or not. Pick a voice, and start noting the types of melodies in the accent. Take notes on what sounds they stress and relax on.
Tom Hiddleston. Because the man is wonderful.