In my experience, the best practice to write a user keyword depends upon the scope of that keyword. Robot framework is flexible enough that it can search keywords in all resource files and even in nested resource files.
If I am using a keyword which is required only for a given suite, then it is better to write that keyword in keywords section of that suite.
If I have a keyword which is used in multiple test suites then it is better to define it in some keywords file which is acquired in those test suites. (It makes your project neater.)
If I have a keyword upon which multiple keywords depend then it is best to write it in a global resource file.
I follow this structure(helps me in maintaining a clean structure):
As you can see in this structure that i am using a directory for global resources which is used by API suites and GUI suites both.
But also i have another "resources" folder in both API and GUI suites which contain those keywords which are required by API and GUI test suites respectively.
This helps me in maintaining API keywords and GUI keywords separately.
Also in some of my projects, I have used multiple resource files to make my project more clear and easy to maintain.