When you think of guitarists like Prince, John Mayer, and many others, they are known for switching between rhythm guitar (while they are singing) and playing little licks during the moments when they don’t sing while seamlessly transitioning from one to the other.
This exercise will help you!
1- Start with a simple chord progression around a position that you are comfortable soloing in.
2- In a systematic way, alternate between one bar of rhythm playing and one bar of soloing
3- Start with simple rhythm patterns and time divisions on your solo.
Remember that the main goal here is to keep the time at all times.
Hope this helps!