Short answer: paste or open the SVG and press optimise. Comments, metadata, editor attributes, empty groups and long decimals go; the drawing does not. The result is rendered above the code and downloaded as .svg.
What is safe to remove, and why
Editor attributes are notes to the editor, not instructions to the renderer. Comments are invisible. Empty groups draw nothing. A coordinate with fifteen decimals came from a transform matrix, and rounding it to two moves the point by less than a pixel while shrinking the file noticeably. None of that is guesswork — each one is a category this tool handles and nothing else.
The optimisations it refuses
Path simplification, transform flattening and group merging all change geometry. They save more and they break artwork, which is why they live in dedicated tools that can show you a pixel diff. A page that quietly rewrote your logo to save four kilobytes would be worse than one that leaves it alone.