Here's a good style guide to follow - https://wiki.mozilla.org/QA/Execution/Web_Testing/Docs/Automation/StyleGuide#Locators.

Remember we can and should always file bugs/ping the devs to create better locators if need be.