You access the rails console from your server. If you have a search there are quite a few topics that go into more detail, but it’s essentially:
SSH into your server
cd /var/discourse
./launcher enter app
rails c
Though I should also say to make sure you take a back up before attempting any changes, as accidents can happen.
Administrative Bulk Operations has quite a few examples in if you wanted to read up before trying anything.