You're a "grower".
As far as a sexual partner is concerned, you've got the right stuff to please; nobody who wants to have sex with you is going to care about your flaccid size.
It's really just an issue of anxiety, that you want to impress other guys in a locker room.
Why exactly some guys shrink way down when flaccid and others are always about the same length is a bit of a mystery. We know that it's caused by contraction of the dartos fascia, but the reason that some are more prone to it under normal circumstances isn't well understood.
In terms of dealing with it, there's basically 3 things you can do.
1] Nothing. Just live with it because there's really nothing wrong and your junk is plenty long when hard.
2] Botox. Monthly botox injections into the penile fascia causes dartos paralysis and therefore a longer flaccid penis. IDK about you, but I'm not about to go out and have needles stuck into my junk once a month...
3] Penis enlargement. There are a multitude of mechanical techniques [stretching, pumping, clamping, jelqing...] that some men use to increase the size of their penis. Whether these are safe or even effective is not well studied, so caution must be exercised. The one thing that universally doesn't help are "supplements" marketed for male enhancement; that shjt just doesn't work.