One of my grandsons had a similar problem till he was almost 8, wetting the bed when he was asleep, or having to be woken up to be on the safe side, and so my daughter bought a little gadget over the internet which was clipped to his pyjamas, which had a wire which attached to his trousers and, at the first sign of a drop of "wee", gave out a shrill alarm, which woke him up so that he could get to the loo in time. He only had to use it twice and has never had a problem since. (He is now nearly 12.) Somehow, the use of this programmed him to wake up naturally if he needed it. It's worth a try.
Sometimes, during the day, children don't want to use the loo as often as they should, and try to hang on till it's too late. Assuming that there is no medical reason for the problem, most children grow out of it. My elder daughter, who was then well over 4, used to go to bed with plastic pants, and a terry nappy pad (long before the days of disposables or pull-ups!) and was still very unreliable at night. We were looking after a neighbour's 4 year old while his mum went in to hospital to give birth, and this little boy asked my daughter "Why are you still wearing baby pants?" My small daughter told me "I don't want these any more" so we abandoned this method, and she never wet the bed after this time.