Put a deep conditioning mask in it and work through the mats with a wet brush, or my fav the Sheila Stotts brush, while it has the mask on it.
Your fingers and tail of your comb will be your bed friend . Work slow and be patient. Wet brush. I know a lot of people like to work on wet hair. (Personally I like dry hair depending on how bad it is) but it HAS to be either wet or dry no in between. no yanking. Pull the pieces you can pull apart with your fingers first(gently) Then starting at the ends just start to detangle the really matted pieces with the tail of your comb. Get as much out that way then go in with your wet brush. And go back and forth between the two. I always had extremely matted hair growing up because i would keep my hair in buns for weeks and so this is my trick that works well for me. ❤️
I agree I think working through tangles and matting dry is easier.