Thats a very broad question you have asked. I suggest you should read the blog on validation and error metrics.
You should understand that there are three main topics (and the consequent subtopics) in Machine learning, namely
- Supervised Learning
- Unsupervised Learning
- Semi-supervised Learning
Why am I saying this? Because I want you to know that in each subtopic of ML, the algorithms can be tested by the same error metric. For example, Logistic Regression and Random Forest are classification algorithms, and can be tested by the accuracy metric.