If you want the nuts and bolts of it, expressivity in music is probably boiled down to variations in the amplitude, timbre (how hard/soft you're hitting the strings, though this is obviously mingled with amplitude) of each note, and the time you put in between each note. Vary those and you'll have more expressive music.
To put it in terms of playing "from the heart", take a song or piece of music. I find this much easier to do with classical pieces. Then, play through it a few times. Try to get a sense of the emotion the music is portraying. Are some parts happy? Are some parts sad? Are some parts suspenseful, surprising, or somewhere in between? How do you express that? You could get louder and brighter at the happy parts, and softer and more quiet at the sad parts. You could slow down the notes of the sad part slightly, or speed up the happy part. You could do a dramatic shift in your amplitude from low to high to express 'surprise!' or 'intense!'. You could also go from high to low, to express 'sorrow', or 'shock'.
Timing is immensely important as well. As a processor of music, your brain does many things while a melody is playing. The important one to note here, is that every brain has a tendency to try to predict a pattern in music, and expect certain notes to follow others. Have you ever played through a scale and left out the last note, or the last two notes? Try it now. Feel the sense of anxiety, the tenseness your body feels when those notes are unfinished. These are feelings you can evoke in your listener. Start a phrase, but end it slightly later than you've been ending others. Your listener will feel anxious, but you'll resolve that anxiety for them in a second. Or you won't. Maybe leave it hanging in the air, just like what you were trying to express with your lyrics. Maybe bring it on at a speed that's faster than the listener expected. That'll provoke an emotion too, maybe surprise, or unease, or even satisfaction.
When people say you're playing with emotion, they really mean you're playing with their emotions as well. You're evoking emotional responses beyond the notes in the scale. You're varying timbre, timing, and amplitude to elicit feelings that a guitar playing machine, for example, could not. To make it clearer, play with some variation that humans can put into it, and not just the notes that a music box could play just as well.
Furthermore; You have to get to the point where you're not thinking about playing the song. If you're having to say "Ok, I go to the 5th fret after this ..." etc., then you can't play with emotion.
Once all the technical aspects are on auto-pilot, and you can play the arrangement without having to think "that complicated bridge comes after this ..." and play every part without having to count anything, then your brain will be able to simply focus on how you play something, it will focus on *expression." Am I playing this aggressively, softly, am I holding this note longer than usual, bending it at an interesting spot because that's what I'm feeling at this exact moment, etc.
You'll probably start out by thinking about how to play it with emotion, which still doesn't put you where you want to be, but it's kind of what you have to do. Eventually, once you play it enough times, and have the rhythm count stamped into your brain, and a pool of "ways to express" this part and that part, your brain will pull from them automatically based on how your feeling, or how you want to convey something in a particular moment ... and it will be able to do it naturally.
source: reddit