Here are some ideas you might want to consider.
Thank your friend for being brave enough to tell you. Don't pass judgment on your pal. Maintain your friend's privacy. Tell your friend that you still care about them despite everything. Don't take yourself too seriously.