I can't get my device to connect to wifi, even sitting next to my router when it says it has excellenct signal strength

it says optaining ip address and then disconnects every time. This is my second unit as the first one i bought had dead bands of cells on the screen right out of the box. I was hoping its connectivity problem was because it was damaged. Any tips on how to get it to work?