People have given advice, also research for solutions. Some times it works, but not all the time. Some of the "solutions" that I have tried and still do is the following:
1. Do not allow him anything to drink after 19:00
2. Make him go the loo before bedtime
3. Take him to the toilet in the middle of night
(not waking him up completely, just picking him up and sitting him down on the toilet to "do what is needed")
These steps I follow every night as a bedtime ritual, and I have to say that it works most of the time.
But the "accidents" still happens.
But don't despair. Bed-wetting isn't a sign of toilet training gone bad. It's often just a normal part of a child's development.
One day I research why this does happen, and if it is normal for a toddler his age. Apparently these "accidents" should get better by the time he is 7 years old? They call it "bladder control" that gets better as the child gets older.