That depends on several factors. If I'm familiar enough with the airplane that I'm confident I can prevent the pilot from killing me if I have to intervene that's enough right there unless I also suspect that said pilot wouldn't heed my verbal warnings or relinquish control if I asked "nicely" when I felt his continued operation was dangerous. Typically if I had concerns about the pilot's lack of experience or attitude toward safety I'd probably discuss said concerns prior to the flight and might decide to pass on passengering if there was serious disagreement.
In any case I'd want the pilot to agree beforehand that they would discontinue any course of action that either of us felt was unsafe. I've never met a pilot who wouldn't go along with that but if I did that would probably be enough for me to reject a flight with them. I'd also pay some attention to the condition of the airplane excluding cosmetics. Finally the expected challenges/difficulty of the flight would be a big factor for me. I have no concern riding along with most any reasonably competent pilot in an airplane they've flown (successfully) before on a simple daytime local or short XC flight in an area lacking terrain issues with good weather. Throw marginal or IFR conditions, mountains, night, etc and I'd get a little more fussy about who was piloting the airplane.
Beyond that, say going for a ride in a jet (I have no experience in any) or anything else I'd consider myself unlikely to be able to fly on my own I'd definitely consider any information I had about the pilot's experience and attitude toward safety before accepting a ride and if I harbored any suspicions WRT any insufficiency there I'd either inquire further or decline on the spot.
I must admit there was a time that I'd go with any pilot in any aircraft given the opportunity with nary a second thought WRT my safety but I've come to learn that all pilots are not created equal.
For a case in point, a couple years ago a local pilot purchased a derelict BE-18 (Radial engine Twin Beech) that had been sitting at my home base for several years. The pilot (sans A&P) performed some maintenance work on the plane and got the engines running so he could fly it to a different nearby airport where he had a hanger. He obtained a "ferry permit" but didn't have a licensed mechanic sign off the airplane for the flight as required by the permit. He had drained an estimated "several gallons" of water from the fuel tanks before taking off on this illegal flight and when he raised the tail during the takeoff roll both engines began stumbling, belching smoke etc according to witnesses. But rather than abort he continued the takeoff and got several hundred feet AGL before he lost all power. Shortly after that he crashed into a barn under the downwind leg and the ensuing fireball killed all on board. And most sadly he wasn't the only one in the airplane even though the ferry permit dictated "essential crew only".
The sole passenger was a nice young woman student pilot who had competed with a friend of mine in a recent "Power Puff Derby" as a navigator. She happened to be in the FBO lounge when the BE-18 pilot asked if anyone wanted to go for a "ride" and accepted the offer without a second thought. My friend who was a fairly experienced albeit young pilot probably would have accompanied the two had she been present but fortunately she had left earlier. And I can see my self accepting a ride under the same circumstances when I was a student or newly minted PP as I was eager to learn all I could about any airplane (still am) and getting to fly right seat in a big old twin would have been very attractive.
Did I mention that this pilot had zero time in BE-18s and IIRC not much multi time at all and certainly no recent (i.e. past year) AMEL time? Would that have caused me to bail if I learned that as a student pilot? Probably not but it would certainly be a big red flag today, same for the fact that this was the first time the airplane was airborne in several years but I don't know if the young woman was aware of either situation or that she would have been concerned if she did.
I sort of realized that I am very new to flying and as of late have just been flying all over creation with lots of new pilots. My CFI is churning them out.
Bottom line, brand new pilots working on their first logbook can be (and often are) just as safe as the pilot who's "been flying since forever" if they have the right attitude and understanding of their own limitations.
And I'm happy to say I've had the honor of being the first passenger for one or two new pilots and had no fears on those flights.
A Beech 18 ride is more likely to end badly than in most light airplanes. They are all old, it takes a briefcase full of 50 dollar bills and a knowledgeable mechanic to maintain one, and an experienced and current pilot fly it. There are not very many pilots (and I know a few) with whom I'd be comfortable getting in the back of the twin Beech while they were at the controls. Given the situation above: aircraft sitting derelict for some time, a shade-tree, untrained mechanic to bring it back to life, and a loose nut in the hero chair, the loss of all aboard was tragic but predictable. I'm sorry for your loss.