Is it okay to pee/sleep with a tampon in?

I have a bladder problem which makes it super hard for me to hold my pee in, so when I have to go I GOTTA GO, I can't hold it long enough to take the tampon out. I've been told it wasn't safe like I know you're not supposed to sleep with one in (which I also do every month) but I was just wondering like what's the hazards of peeing and sleeping with tampons in? I'm new to this whole tampon thing I'm sorry if I sound a bit childish.