Final answer:
Diagon Alley and Knockturn Alley can be accessed through the Leaky Cauldron by tapping a specific brick, using Floo Powder, by Apparition, or through secret passages.
Step-by-step explanation:
One can access Diagon Alley or Knockturn Alley through several magical means. The most commonly known method is through the Leaky Cauldron, a magical pub that serves as a gateway for witches and wizards. Entry into Diagon Alley can be gained by tapping a specific brick on the wall behind the pub with a wand.
Another way is via Floo Powder, which involves stepping into a fireplace and stating your desired destination clearly. Apparition, a form of magical teleportation, is also possible for experienced witches and wizards who can focus on Diagon Alley as their destination.
Lastly, there are secret passages and routes that may lead into these magical alleyways, but these are less commonly used or known to the public.