The first thing to know is that it's normal for fly lines and leaders to have memory. When pulled off the reel they will coil up in the form that they had been stored on the reel. Not all are created equal. Some have more memory then others. Some are so bad that you may never get them straight. This is especially true of old leaders.
The leader can be somewhat unruly so I usually straighten it before the fly line. You can buy a leader straightener which is usually two pieces of rubber sandwiched between leather. You squeeze the leader between the rubber and pull the leader through it. The friction causes the leader to heat up and reform to a new shape, preferably straight. I tried a piece of rubber bike inner tube a few times and succeeded in leaving black rubber on the leader. When using rubber pads it is hard to tell how hot the leader is getting. Heating a leader weakens it so the less the better. The easiest way to keep the amount of heat in check is to use your fingers.
To straighten the leader with your fingers, both the leader and your fingers should be dry. Otherwise it will be hard to create the little bit of heat that is needed. Hold the end of the leader in one hand and with the other hand squeeze the leader between your fingers. While squeezing run your fingers down the length of the leader or as far as you can go. When you near the end of your reach hold the leader tight in both hands and keep stretching it as it cools. You don't need to do the whole leader at once. You can straighten the leader in segments to achieve the same result. The leader does not always straighten the first time so repeat this process as many times as needed to get the coils out. If the coils still won't come out, the leader is probably old and used up. Time for a new one.
Straightening a fly line is easy. All you have to do is stretch it. Just pull on it with your hands to get the coils out. You can also hook the fly line under your foot and pull up on it with both hands just enough to get the coils out. You can stretch a lot of line fast this way.
If your line still does not straighten it could have twists in it from casting. The easiest way to get these out is to take off your fly and let the line hang down stream. The current will take out the twists. On still water let it trail behind you as you paddle or motor around.
The next time you have to deal with line and leader memory. Set them straight using your hands and fingers. They are free and always with you, hopefully.