I was in this situation at the end of my very first solo cross-country flight many years ago.
I was in a Piper Archer, in the middle of the night, after flying from Marathon, FL to Lexington, KY (with two stops in between).
Forty miles out, the field was beautiful VFR with calm winds.
Thirty miles out, ATC advised that the visibility had dropped to 6SM.
Ten miles out, ATC advised that the visibility had dropped to 1SM, so I requested a contact approach to expedite my arrival before the visibility got even worse. That's when they advised that it had actually dropped to 1/2SM, which is lower than the 1SM requirement for a contact approach, and lower than the 3/4SM minimum for the approach in use (ILS 22).
I requested vectors for the ILS 4 instead (minimum visibility of 1800 RVR), and after a little bit of mental gymnastics by the controller, they said "Sure, why not? Nobody else is out here anyway, so we can switch the airport around."
By the time that I was on final, they advised that RVR was down to 800 feet. I could see the runway lights perfectly, but could also see the fog sitting over the airport.
I momentarily debated what to do (I was tired, and didn't really want to divert... at least I had made the extra fuel stop and had plenty of fuel left though!) before realizing that while I could legally continue the approach, I would almost certainly have to go missed at a very low altitude when I entered the fog since 14 CFR 91.175 states (emphasis mine):
§91.175 Takeoff and landing under IFR
...
(d) Landing. No pilot operating an aircraft, except a military
aircraft of the United States, may land that aircraft when—
...
(2) For all other operations under this part and parts 121, 125, 129,
and 135, the flight visibility is less than the visibility prescribed
in the standard instrument approach procedure being used.
While the flight visibility was fine at the moment, as soon as I entered the fog, it would drop below minimums, and I would not be allowed to land.
Note also that this was for an actual instrument approach. If it was visual, than I would have also had to avoid the "ground cloud" (aka fog) by the cloud clearance requirements specified in 14 CFR 91.155 by staying 1000 ft. above it.
If you have reason to believe that this isn't the case (maybe it's patchy fog and it's clear at the beginning of the runway), then you can go ahead and fly the approach, and land as long as you don't enter the fog and lose the required visibility or airport/runway environment spelled out earlier in the same regulation.
For those that want to know the rest of the story, I ended up diverting and then had to divert from my alternate (which was clear when I started there but completely covered by unforecast fog when I arrived), and then fly a low visibility approach at a third airport. Once I landed, I went into the FBO and slept for the rest of the night in one of their recliners.
I wouldn't recommend that most people try this on their first solo IFR flight though!!