Some posts seem to suggest I should write tests for everything. Is it true or is it a case-by-case basis?
This question potentially leads to an over-simplification or at least a way to miss the point of testing, as it could be framed in such a way that it might sound like approaching testing simply for its own sake or following what others tell you to do.
Consider re-framing this about what kinds of tests should exist, and how to avoid the trap of producing tests whose purpose is simply about checking a box or meeting some coverage statistic.
What's missing is consideration about to whether a test has any real value to anybody; in particular, whether the tests are checking real functionality/behaviour that users, QA testers and stakeholders care about. Given that the question mentions bug fixing, that sounds to me a lot like something these people should care about.
On the other hand, it's quite easy to write totally meaningless tests to feed into some arbitrary statistics, by only pointlessly testing the structure of the code, or test behaviour belonging to 3rd-party libraries, or even test the tools/language itself. Most of the time, those kinds of tests take up time without ever serving anybody.
Instead consider the real reason for writing tests in the first place; particularly thinking about how people (developers, users, QA testers, other stakeholders) might get real value out of them.
In general, tests are a way of protecting the quality of the software - their value to users is fewer bugs up-front and fewer regression issues in the future when the software changes. Their value to QA testers and stakeholders is similar, as well as confidence that developers have understood the requirements and are doing their job properly. Finally, their value to developers is helping those developers avoid breaking existing code, and have confidence in their understanding of how the code works and why the code exists.
With that in mind, consider that the existence of a bug must imply that either some test/s had been written with wrong expectations, or a testing gap; otherwise somebody else would have noticed the bug before. It also suggests some oversight by whoever touched the code before (because all developers are only human).
Lastly, tests can indeed be a helpful tool for organising your thought processes and double-checking your assumptions; even if they are a bit like "marking your own homework", they're just one layer in (hopefully) many other layers of quality assurance, protecting against the existing behaviour being broken by future developers.
If there are correct tests around some behaviour, then future developers (or 'future you') can confidently revisit that same code; perhaps to adapt it to some new requirements, or maybe to refactor it, or perhaps to fix some other bug; all without fear of accidentally breaking something which was working before they touched it.
As an added bonus, future developers can also read and run/debug tests in their IDE to help them understand why some code exists, understand its expectations and the original requirements, so the tests serve as documentation for them too -- except unlike plain-English written documentation, this 'documentation' is always verified directly against the real code before anything is merged into the main branch, so it cannot go stale.
GetUsers
returns the users full name"?