Let's handle the most obvious question first: Why minify CSS or JS?
There are two reasons. The first is to reduce the size of data being transferred across the internet. Removing comments and spacing can reduce these by as much as 40% of their original size. The second is to condense the space ... in real time.
The second is important. This means that the CSS file or Javascript (or Jquery) file can remain in development mode and readily readable. When rendering the page, those get "minified" with all comments and spacing/indents removed. If the minify utility works hand in hand with the HTML beautifier, you should end up with <style>...</style> and <script>...</script> all on one line.
At the point of a published web page, reading the CSS and Javascript as a user is not needed.
I also find a third reason that may be unique to me: I like hiding my code. I spend a lot of hours developing. Much of my software and code has been "borrowed" over the years ... if someone wants my CSS or Javascript, they can take the time to unminify.
Finding appropriate minifiers shouldn't be that difficult. There are many available as "open source" software. What makes it difficult, though, is adding "that works" to the end of that. It's almost impossible to find appropriate minifiers that work. Kudos to the developers, though. They did create software that works for them in their particular circumstances. I encourage that and developers putting their code into the public domain with open source licensing. It encourages creativity and cooperation.
The most difficult part of minifying CSS and Javascript is handling comments. There are basically two different types of comments. Multiline comments start with /* and end with */ ... those are fairly simple to remove. The only issue happens with Javascript (anytime I mention Javascript, include Jquery too). When using one of the preg match commands, you need a pattern. The pattern definition often includes either a /* or */ as part of the definition ... and that can break a minifier. The more difficult comment, though, is the one that starts with // (double slashes). Problem is that there is no "closing". This type of comment is used on a line by itself (easy to identify) ... but can also be used at the end of a line after legitimate code. That means it becomes almost impossible to detect when other legitimate code can possibly have two slashes as well. For example, a variable with a hyperlink with either http:// or https:// ... as the first part of the hyperlink.
I tried several Javascript minifiers and never really found one that was suitable. That is, until I found JShrink. JShrink is a single-file class that works quite well. All the reviews I have seen show JShrink as the leading javascript minifier. Most even have it as 100% error free results. I'm satisfied with it – but I did need to make one small modification to the package to suit my needs. JShrink is available on Github.
The CSS minifier I use is one that I have used for several years. I originally created it and have modified it over the years when I ran into a few issues. It suits me well. I do not offer it for download and is not generally available.
The JShrink modification I made is to include the <script> and </script> tag based on an "options" setting. I already have the same options tag setting available on my own CSS minifier class.