Try starting with a looping bassline, and playing one note at a time , notes on the right hand till it matches and sounds right, you can start with only 2 notes at a time and work your way up. But just consider a chord to be a "Bottom Line" (Bass) and a "Melody" (Top-Line) The rest, or the middle parts of the chord are, inner parts, and supporting lines. You only need bass and topline to start with.
Just practice improvising over a looping bassline and don't be afraid to make mistakes!
Copy your favorite melodies, and see if you can make something sound pleasureful. The only rule to a good melody is charm, pleasure, and if you're advanced, beauty and symmetry. But emotion will come with personal taste and locking in the pleasureful notes with the bassline.
See the bassline as a support to your "right hand" or your "top line" . Give that a try, and try to imitate your favorite songs and artists! Don't be afraid to play the wrong notes! It happens in the beginning. Eventually you'll develop a taste for the "right notes" or the notes that give you pleasure. Pleasure is all that matters right now.
Don't worry about catchiness, or emotion, or beauty, or anything fancy. Just go for what feels good in your belly, heart, ears, whatever it is.
Also, feel free to identify the different styles, and differentiate "soul" rnb-type melodies, vs. Hip Hop melodies vs. classical-style melodies vs. Pop etc. -- Sometimes knowing the different origins helps in applying the "right hand" or "top line" to your bassline style. The more you understand the "language" , the more you can write in that "language". It's like learning English vs. Spanish vs. French etc. or the British Accents vs. the Italian vs. the Australian vs. the American accent