A key aspect of cycling is learning how to stay motivated, and to recognise the signs when you are becoming demotivated - even cyclists who love cycling all the time can have periods when they feel that they can't be bothered to get the bike out. Sometimes this demotivation will also involve minor illnesses, or aches and pains that just don't seem to go away.
Very often this can be due to over-training, and it does no great harm to take a week or even a few weeks away from cycling if you have been overdoing it. If you are finding it an effort to get motivated, a period away from cycling is better than carrying on regardless and reaching the point where you just don't want to do it any more.
Less can be more! Is your cycling schedule too difficult to keep up given the other pressures in your life? If so, make it easier - while it's great to improve speed and ability, at the end of the day having fun is more important. Missing a day or two from your carefully planned training schedule is better than reaching the point where you give up cycling altogether, and rest days are as important to your training as days of hard cycling
If all your cycling is part of a rigid training programme, with constant work on endurance, speed, intervals and so on take the occasional day where you ride simply for pleasure.Find a decent length ride and set off, taking time to appreciate the scenery instead of staring at the road ahead while you try to maintain a given cadence or heart rate, taking it easy on the hills, perhaps even leaving the bike computer at home (or at least not looking at it all the time).
Remind yourself why you are cycling in the first place - for health, to enjoy the scenery, because it makes you feel good...these are all more important than increasing your average speed by 1mph.
The general rule in a cycling training programme is that you should spend most time doing the things you are less good at, whether that is hill climbing, sprinting, descending etc, because improvements in your weaker areas will make a bigger overall improvement than training at things you are already good at. But if focusing on, say, hills, is really making you demotivated find a flat route once in a while where you can just enjoy yourself.
Cycling in a group or with a friend is another excellent way to stay motivated and keep improving, since it's almost impossible to cycle with others and not have the competitive element creeping in. You'll be working just as hard as with a training ride but now it feels like you're having fun rather than over-training!
Overall, try and find a level of cycling where you always want to do more, not where you are doing too much, and remember why you are cycling in the first place, and your motivation will return in no time at all.