For what it's worth and only to pass on my experience so others may learn.
During my qualifying cross country some years ago, I flew into IMC over Kent.
I immediately did a 180 and made a call to the station I was talking to.
After about 1 minute or so, I popped out into clear blue and returned to my home base.
I had lost no height and was feeling pleased with myself.
It was only after, that I realised that I hadn't stuck my head down in the cockpit at all after I had completed the 180
and I kept straight and level whilst looking ahead into thick cloud. Not he best thing to have done.
A few years later and after a bit of IMC training, I was caught in cloud whilst turning base leg. This time I reverted solely to
inside the cockpit and with help from a radar service I came out of cloud at 300' on finals.
The first time I didn't panic, the second time I didn't panic, but the first time I didn't follow what I had been taught.
I was solo both times and I am sure that helped my concentration.
These experiences also taught me to quickly react to the situation, don't sit there, don't panic, act.