How to enter AT mode in HC-05 bluetooth module

You are talking about while you are programming the HC-05 right?
I understand this gets a little confusing. It was confusing for me too when I first studied these devices.

When you have connected your computer to the HC-05 via the RX and TX pins, and the HC-05 is in programming mode because you held the button while powering it up, your computer is communicating with it on the RX and TX pins and you need to talk to it at 38400 baud. At this point the Bluetooth radio is not working and not paired with anything.

When you are no longer programming it, and have powered it down and back up, and you have connected your computer to the HC-05 via the RX and TX pins, your computer is communicating with it on the RX and TX pins, you need to talk to it at whatever baud rate you programmed it for. You can then pair another Bluetooth device with it and your computer can then communicate with that other device which is paired with your HC-05.

When you are no longer programming it, and have powered it down and back up, and you do not have it connected your computer via the RX and TX pins but instead you have paired your computer to it via the computer's built-in Bluetooth, whatever device you have connected to the HC-05 via the RX and TX pins must communicate with it at whatever baud rate you programmed it for. Your computer can then communicate with that other device.

Now that I've typed that into this post, I understand it is something which is challenging to understand, and I hope I have not added confusion. These HC05 modules are versatile.