Getting hard staying hard

I don’t understand sometimes I’m good to go but other times and it seems the times that matter most I cant perform. Is it really just stage fright or what’s up.

Have you noticed anything different in those two situations? Do you tend to be more in your head sometimes?