Could be an ammonia spike, swimmer bladder or numerous things actually. When was the last time you changed the water? What's the water parameters? Are there other fish in the tank with this goldfish? What kind of filtration do you have?
Welcome to Fishlore!
Please fill out the Fish Emergency Template, as Fisheye suggested. There could be a variety of things going on with your fish, maybe it's just normal. Tell us things like tank size, tank mates, water parameters, etc. so we can help you identify what is going on with your fish.