When you start out, just doing the activity makes you improve but as you get better, it becomes necessary to train specific things to improve further, which is when having a training plan is helpful.
The first step to working out what to do is to write down your goals in as much detail as possible, including specifically what you will have to do to be successful. How far do you have to run or ride, how fast, etc?
Then write down what you can do now as accurately as possible. If you don’t know, get out and find out as accurately as you can.
Now you know what changes you have to make to reach your goal.