Feedback starts with volume. Lots and lots of volume. You need to create a physical loop between your guitar and your amplifier: sound goes out of guitar, in to amp, out of speakers and the vibrating waves vibrate your guitar and it's strings which in turn goes back in to your amp and out of the speakers and...well...you get the point.
So start by turning that amp up.
Controlling the feedback is the next thing and the rub is: how you control it to produce a specific note is going to depend on the guitar and amp and the environment. It can change. But there are some basic techniques you can employ in every scenario. First, you'll want to mute all but one string. You can use a combination of right-hand palm mutes and left-hand string mutes to achieve this. But you want to make sure that just one string can vibrate freely. That'll let you home in on that long, singing, held note you're after.
Next you need to find the right string and fret position where good resonance starts to happen. This is going to differ for every guitar. I'd start by trying to play the note around the 9th fret area of the neck, and on one of the strings in the A-D-G-B range rather than the low E or high E string. With all the other strings muted, pick the note (lets say an E on 9th fret, A string) and hold it. Try pointing your guitar so the pickups are aimed right at that loud amp, and then move the guitar around until you can feel the body vibrate, stronger and stronger. That's the feedback loop amplifying as it moves through the closed system and the you get constructive interference in the vibrations in the body and the string.
It's going to take some practice, but eventually you should be able to pick any note and find the right way to angle your guitar at your speakers to have the feedback for that specific frequency build nicely.
I recommend hearing protection and sympathetic neighbours.