if you have a flashing selection light then this means there's a logged fault with the unit
I'd suggest the next thing to do is to get a dealer level diagnostic tool plugged into the car and pull off the fault code as this will greatly speed up the repair as its will point to the fault
I would also check the basics, take a look at the colour of the transmission oil it should be a dark red colour if its black thenits needs changing together with its oil filter. Also check its level with thegearbox warm and just after you've moved the selector through all the positions leaving it for a few seconds in each one and then back to park.
You can top up the box through the side fill plug if required and make sure you use the correct oil for your car as the fluids are not all the same. Some manufacturers recommended a change of the type of fluid - Speak to the local dealer and parts dept - theywill advise you on the updated fluid to use..
If that’s all OK then check all the electrical connections of the gearbox, remove each connectorin turn and spray with contact cleaner. Check that the wiring to the gearbox isin good condition with no chafing or frayed wire
If this is OK then check the selector lever linkage / cable under the car for any broken parts and or missing bolts as if this is coming adrift then it can rub on the car body or just bind up
Then - you shouldtop up if low and re try it - or, if its level is ok - and condition is ok -then the next step is to drain it off - open it up and clean the filters inside-- refill and retry it.