At the top level, you could consider an approach roughly as follows:
- Use a static class method for simple logic where all the logic can be self contained in that static method. E.g. you could use a static method for a
RemoveSpacesFromString(string text) method that just acts on the passed in string.
- Use a service where you have a method that makes calls to other methods, or especially where that method needs to retrieve data from another location (e.g. a web service) or access a database
Decisions about when to use a class, a static class or a service aren't specifically a Blazor issue, but really relate to concepts like making code testable and allowing substitution of new functionality without having to go back and alter code that is already working.
These are broad topics, if you aren't already up to speed on them you may want to read around Dependency Injection, Unit Testing and the SOLID principles (this is a Microsoft blog on SOLID that focuses on .NET examples).
Essentially, injecting a service allows for simpler and more focused testing, whereas using a static method means that every time you test the method that calls the static method, you are also testing that static method - that can be either a good or a bad thing, depending on the context and functionality of the static method.