The feeling of needing to pee ?

Recently I haven’t really been able to sleep because I feel like I have to pee a lot but only a little bit comes out, but it doesn’t hurt at all? My grandparents said it may be a UTI but I couldn’t understand how if it doesn’t hurt...can someone help me?