Plugins are merely lines code of written to achieve something. You need lines of code to achieve something. If you don’t want to use a plugin then you will need to write your own code. Unless you are experienced, then looking at the codebase of existing plugins that create custom fields may save you some time developing your own custom code. Good luck!
Thank you for your comment, the point is that I am not asking to solve the problem for me, I just ask people to share information, maybe someone saw how this is done (I cannot find anything suitable on google).
There is only one plugin on my wordpress site and it is for caching and I would not like to change my principles