Magento is based on MVC system, and the MVC doesn't only contains helper files, each file have it's path and it's usefulness.
Model: represents your data structures, Typically your model classes will contain functions that help you retrieve, insert, and update information in your database, also ORMs (Object Relational Mapping) get you out of the business of writing SQL and allow you to manipulate a datastore purely through PHP code.
Block: Magento blocks are used to pass data to phtml, that this block gets it's data from Model.
Helper: helper function is a small convinience function that doesn't really belong somewhere that helps you to do something you can already do, albeit with less typing. An overload that forwards with the usual defaults for example.
Magento's Helper classes contain utility methods that will allow you to perform common tasks on objects and variables.
Observer: Like any good object-oriented system, Magento implements an Event/Observer pattern for end users to hook into. As certain actions happen during a Page request (a Model is saved, a user logs in, etc.), Magento will issue an event signal.
I think you have understood the usefulness of each Magento files which I noted above (There are also other files). So There is not one place better than the other to put your function, it depends on the use and usefulness of your function, what is the purpose and where it will be used.
For exemple: If your function handle data database informations, then you display them in phtml, I tell you to create your function in
public function getCustomData() in this function you get your model inside..., afterthat you get the result of your
getCustomData() function in phtml like this :
More information in Magento Devdocs.