Loyalty is not something you say. It is something you live.
If you consider yourself a true friend then loyalty should be natural. It means protecting your friend’s name when they are not present. It means choosing honesty over popularity and integrity over convenience. True loyalty shows up when things are difficult not when they are easy.
If your values no longer align then be honest enough to step away. Pretending to be loyal only damages trust. You can stay loyal or you can stay away. What you should never do is pretend. Loyalty is not tested when things are easy. It is revealed when things are hard.