my right side of back hurts so bad

i was trying to go to sleep but i can’t move in a certain position cuz my right side of my back hurts!!! i think it’s my rib idk what it is i didn’t do anything to make it hurt😰😰😰😰😰 it’s not my appendix ..... could it be my kidney )?