All trial and error. When I first passed my test, I was terrified of parking. No idea why, it was always my strongest point. My instructor would always take the Micky out of me because within 10 hours of lessons I could park like I've been driving for years, yet sometimes failed to do basic things like navigate roundabouts, signals and stuff like that
I always tend to find a reference point on my car when reverse parking. Might mean going to a car park on your own or with a friend when it's quiet (in the late evening, for example) and try stuff out, looking to see when a certain point of your car lines up with one of the lines being a good time to stop. Might even choose to put a little sticker somewhere as a reference if you're really struggling.
As for forward parking, I just find that practice makes perfect. Do it enough times and you just get the feel of when to turn. Honestly, though, I rarely park forwards these days, find it just as easy to reverse in and it also makes getting out easier and safer, though it's a pain when you want to reverse into a spot but some idiot is right up your backside even though you've signaled to give them an indication that you've found a spot and you wish to pull in (the idea is for them to recognise this and give you some room, but some just pay no notice).