I REALLY don’t agree with giving Amazon money (ethically) but I am a hypocrite and end up buying a lot of ebooks and audiobooks from them, I do my best to back up the files using calibre but I‘m sure they could lock down devices / files using DRM and their latest DRM incarnation is very hard to remove. I try to buy DRM-free ebooks and audiobooks whenever possible but I think mostly due to market domination authors and publishers end up at least mostly exclusively providing content via Amazon.
As for books, when I buy them on Amazon I select "transfer via USB" which let's me download it and when I add it to Calibre, the DRM is stripped by DEDRM_tools [1][2] before transfering into the Kindle.
[1] https://github.com/apprenticeharper/DeDRM_tools
[2] Note that the tool only removes the DRM, it doesn't anonymise the file. It's still associated with your account.