My cron job is not being automated. It works when I run it in the browser automatically
Did you follow the instructions here? https://docs.moodle.org/27/en/Cron
If that doesn't help, some environment info would be helpful--like windows or linux, which version/distro, and if it's hosted, which hosting environment.
Each of these has its own way of configuring a scheduled background task, so you'll get better help by being more specific about what you're asking.