Earning Robux on Roblox has historically involved a few different methods, though the exact systems have changed over the years.
In the past, players could earn tickets simply by logging in daily, by spending a certain amount of time in games, and by having visitors come to their place, earning a ticket per visitor if they were not a Builders Club member. Those tickets could then be exchanged for Robux through the currency exchange feature, trading a set number of tickets for Robux at the going rate, and the process could also work in reverse.
Because Roblox has updated its economy significantly since then, with the old ticket system retired, the most reliable way to know the current methods for earning or purchasing Robux is to check Roblox's official help and account pages. That will always reflect the accurate, up-to-date options.