You should walk on the side that provides the best visibility between you and any vehicles using the road.
If the road is straight (or somehow there is great mutual visibility even around bends), it doesn’t matter much.
If the visibility is limited, walk on the outside of any bend. This may mean (carefully) switching from one side to the other if there are curves in opposite directions.
In all cases, make sure you watch out for traffic yourself (and don’t just rely on them seeing you). If you are walking in the same direction as vehicles, that means frequently turning your head around.
You should also listen for incoming noise, which means you should not wear headphones.
At night, make sure you are very visible. A hi-vis jacket (or other hi-vis elements) would be a (very) good idea, otherwise make sure you have some kind of light, and make sure it is visible when a vehicle approaches.
You may want to move as far as possible out of the way when a vehicle approaches, conditions permitting.
If at all possible, try to find another way!