As all guys above said, mainly practice is the key. But there are few basic things you should stick to.
1.Never push the car over its limits.
2.Don't outbrake yourself, because in most situations it will cost you exit speed. Better do - Slow in, fast out.
Also you need to find your turn-in point.
Leave it too late and you'll miss the apex, too soon and you'll have to tighten your line mid corner. Get this right and you'll have set yourself up for a good line. Remember that the apex may be further round the turn than you can see, so make sure you learn the track and the apex points before driving in anger.
Getting the exit right is one of the main things.
Once you have hit the apex you should be able to reduce the steering lock and increase the throttle.
-Carrying speed in the corner
-Minimising the severity of the turn
-Getting the power on early
There are few lines which you can take in a corner. Won't put much description, as you can clearly see it here:
This is the classic pass.
Pros of the classic / traditional line:
Smooths out corners in the most efficient way
Maintains momentum (especially useful for low powered cars)
Maximises fuel economy
Reduces the chances of understeer or oversteer
Preserves the life of tyres
Now I'll show you the late apex. If the corner leads onto a straight it can be better to take a late apex, straighten the car out early and get the power on for a high speed exit. The amount of grip available is the factor which determines how late you can brake and apex.
Pros of the modern racing line:
Increases the chances of a fast lap in a powerful car
Allows the power to be applied earlier
Maximises the use of any straights following the corner
Allows late braking
Useful for overtaking on a corner
As you know, LFS is full with twisty corners - 1 after another. So you should really think about the next corner. In short:
In a track like AS7 or SO4 and etc there are hairpins. And sometimes you can win your laptime there or either loose it.
So basically this is the key to success. Try to do it like this, and once you get it all in one - you will see the result in your laptimes.