Back at home before flushing we would fill up a bucket of hot water and pour it into the toilet to prevent clogging when our pipes were awful. If it's really bad you can try dishsoap and let it sit there. I've tried coke before cause it's acidic but imo white vinegar works better. You can also try adding baking soda. Though these ''solve'' and don't necessarily prevent. If you moved into a rented place talk to your landlord cause there might be something stuck in the pipes.
Good luck!