This question seems simple but to me it's baffling. Whenever i use the 3.5mm headphone jack i get tons of static whenever i use it. My monitor doesn't have sound so i cant test the HDMI output. what is strangest is that i can actually hear whats supposed to be playing albeit through much static (this can sometimes sound really cool). I'm using a Pi 2 with Raspbian running.
My understanding is that the RPi sound output from the 3.5mm jack is notoriously poor. I get "static" on mine at volume levels below 75%. By contrast, the HDMI sound output is pretty good.
I learned that this was a common problem after building Bob Rathbone's RPi Internet Radio. (http://www.bobrathbone.com/raspberrypi_radio.htm : a thoroughly recommended beginner project.) Bob confirmed multiple such reports.
I have Raspberry 2B+. I cannot confirm if this applies to all other models.
My solution was a cheap USB DAC off your favourite internet auction site. It cost GBP 4.00 and works a treat!