If you are using adb and attempt to get root access by running ‘su’ and instead get the message “Permission Denied”, then there are two things you must make sure you’ve done.
1. Make sure you have rooted your phone. This is complicated and I won’t go into it here – it differs based on what phone model you have. Search XDA for advice.
2. Make sure you’ve explicitly given the adb process attached to your phone access to root.
So, even after you root your phone, when you then connect via adb it will prompt you ON THE PHONE to allow access.

Click “Allow” and then you’re good as gold.