How to fix messed up vertices after sculpting a model
You can use remesh modifier or remesh option from properties or any other tool like instant mesh
Mesh at start:

Remesh Modifier:(make sure not to drag voxel size too quickly or blender will crash)

Remesh option in blender:

Result of remesh option: