What is `attr_accessor` in Ruby, and how does it work?

What is attr_accessor in Ruby, and how does it work?

I’m having a hard time understanding attr_accessor Ruby, Can someone explain its purpose and how it differs from attr_reader and attr_writer?