I take it you're coming from Thornhill, D&G? It might be helpful to know where you're coming from and where you're going to so we can make suggestions.
If so, apparently your fastest route to Edinburgh (and the route I would recommend in the presence of the significant roadworks in Lanarkshire) is the A702, which sadly has a paucity of rail links. The A70 is another viable route according to Google Maps, which lets you use the P&R at Curriehill, but there is a low service frequency at this station. If you're willing to go around the City Bypass, you can get to Shawfair or Newcraighall - the traffic isn't usually bad on that way going into Edinburgh (although can be variable coming out). Both of these stations have relatively limited parking though.
If Livingston North is a possibility, there's lots of spaces at that station. But they fill up quickly in the morning, and the two platforms are actually quite far apart from each other. So if you park on the Westbound platform (which is where the vast majority of spaces are), you'll have to leave at least 5 minutes to get to the Edinburgh platform. It does have a train every 15 minutes.
Sadly, Edinburgh doesn't have quite as many park and ride options available to it as you'd expect when it comes to rail.
If rail isn't the only option open to you, Edinburgh has
lots of park and rides that connect onto the buses and trams. In my experience, Hermiston and Ingliston (both to the West and within easy reach of the M8) usually have plenty of spaces, as does Sherrifhall to the South. (Can't speak for the others). The buses can be quite slow of course, but they may take you to where you need to go.