You need to cycle often, at least 3 or 4 times a week. You need to push yourself and you need to spend a decent amount of time each go. If you can commute this is an excellent way to get the miles in.
If possible just drop down a gear rather than dismounting, if you're running out of gears consider lowering the gearing. There's no shame in cycling at walking pace.
Recording your journey time/distance on a calendar can give you a useful mental push.
Remember, fitness doesn't just happen it takes months of hard work. It's such a gradual process you might even doubt it's happening - keeping a record will help by letting you look back and comparing.
Initially you may even find yourself getting worse as your body fights back - ignore it and press on.
And when you're really struggling - remember that most of the gains are in the last 10% of effort - give up as soon as it starts to get hard and you'll have wasted a decent proportion of the initial effort and not gain that much.
Keep at it though, like most things in this life once you get good at it, it becomes a lot more fun.