It's probably because you're sending invalid data to the server. Did you do any correlation of data in your script? This means extracting dynamic data from the respons in order to send it back to the server.
A good example is a shopping basket id. when you record your script you record shopping basket id 1. If you replay the script it tries to use id 1, but as it's already been used the server rejects it.
You need to edit your script to get the shopping basket id from the server and then send it back in subsequent requests.
There's lots of information available on this, you could try the sticky posts at the top of this forum for a starting point.
Either the request is malformed or there was a serious error prior to the 500 status request . The only way I know to attack this is to log the output of every primary get/post prior to and including the error 500 request and look at what the system under test is telling you. Do this by placing load response statements after every primary get/post and then logging the output. Run the script in modeler. The bottom window will be full of a mix of SCL messages plus a lot of HTML. Copy the entire contents of this lower window into a file and open it with a browser. You will see a decent rendering of each of the pages and hopefully this will give you clues as to what went wrong.
If there are no prior errors and you have parametrized the request (either the URL or the body of a post), check to make sure all the variables you are substituting with have valid data in them and that you didn't somehow accidentally alter the fixed text (non-parametrized portion) of the request.