Hi I just started playing I have an electric guitar and I'm having trouble when playing a fret. Whenever I press down on the fret it sounds muted. The only way I've been able to stop it is when I press down extremely hard on the string right behind the fret, but considering the guitar strings are metal that starts to hurt after a while. So is there anything else I can do to not get that sound or is it normal?
You have to press down just behind the fret. Pressing on the fret itself is guaranteed to mute the note. Yes, this can be painful for beginners, but you will soon develop toughened skin on your fingertips.
You shouldn't have to press extremely hard though. Make sure you have light-gauge strings on your guitar until your fingers harden up -- you might even like to try ultralight strings to start with.
If you are playing more than one note at a time / such as a 'Chord Grip, it is possible that your 'Fingering Technique' needs improvement, as the adjacent finger may be over-lapping. This is often done intentionally, as you play chords/skipping strings. However, a 'Full open Chord', such as the 1st position F Major, has always been a problem for me. It has to do with playing the Note with the very tip of the finger, not the 'padded flat fleshy part of the finger... are you wearing long sleeve shirts?
Also, you might have a guitar tech check the "Action" on your guitar. Basically to see if the strings are too far away from the fretboard.