Interesting that many people are getting this wrong.
The original is "grit and bear it". Many people don't know the word "grit" in this context". It means to "hold your teeth together" or "clench your jaw"... this is what humans do automatically when something unpleasant happens.
"Grit and bear it" means to clench your jaw and deal with the unpleasantness.
"Grin and bear it" is an eggcorn.