The phrase "at least you tried" is often used to offer encouragement or support to someone who has failed or not succeeded as expected. It acknowledges the effort that was put in, even if the outcome was not what was hoped for. The phrase can also be used to express appreciation for someone's attempt, regardless of the result.
There are many benefits to trying, even if you don't succeed. Trying helps you to learn and grow. It also helps you to develop resilience and perseverance. When you try, you are also setting an example for others to do the same.