Try to sing it in your head first. Express yourself and you will find your own way of doing it :) Start with a simple melody.
As few notes as possible. That's what I'd say.
I would recommend you if you want to start from the beginning. Put a backing track from youtube, for example F blues and start playing the chord tones and rhythm variations. If you are more advanced, transcribe tunes and solos
Follow your instinct. Be sure first that you are set up with good balance tuning etc. so nothing to distract you. Then just go without any preconception some are great and in my experince some just are OK. But thats OK. The great improvisations can lead to the best music. Oh yea and listen to a lot of John Coltrane. Hope this helps.
On guitar? Practice scales. On piano? The same. (lol) Or just play, play, play...and after few years you gonna realize that you're understand instrument and feeling free with it. There is no cheats or easy ways. Music is not easy thing if you are composer or player. It's like a gym or calculations in mind. Something like that:d
Listen only to baroque music.
Stick to your key and you cant go wrong !