When men have urinary issues, there's a temptation to:
• Not drink much so you don't have to pee so often (which usually makes things worse), and
• Take any opportunity to go to the loo, so you don't get caught short when there isn't one to hand.
These two actions train the bladder to not expect to fill up, i.e. it learns normal operation is to have a pee whenever a tiny bit of urine has collected.
What you need to do now is to reverse that learned behaviour, which is called bladder retraining. You can look up techniques for that, but typically it is:
Learn some distraction techniques to use when the urge to pee comes, and you will find it passes.
Knowing that you're near a loo can trigger this, and keeping away from one might help. For instance, many men find that arriving home triggers the need for a pee. When you get home, instead of dashing straight in for the loo, take a walk around the block to delay things.
Note what time you get an urge to pee, and try to hold on for 5 mins using the distraction techniques. Over time, you will be able to steadily increase this period.
Peeing into a measuring jug can help monitor progress, since you will be peeing less often but more volume each time. If you only pee a small amount, you can learn that you could have held on longer that time.
You can't do bladder retraining at night - it would stop you from sleeping, but the bladder retraining you do during the day should improve things at night too.
Kegal exercises can help too with preventing leaking.