One may get from Hong Kong to Macau with the 24-hour bridge shuttle bus via the HZMB (Hong Kong–Zhuhai–Macau Bridge), which takes about 30 minutes. One first has to go to the HZMB (Hong Kong–Zhuhai–Macau Bridge) Hong Kong Port (e.g., by bus), where one passes the immigration and buys a shuttle bus ticket to Macau (e.g., with Octopus card). The bridge shuttle bus runs every 5 to 15 minutes (according to https://www.youtube.com/watch?v=whYBITIHTpU). The ticket price for the bridge shuttle bus is currently (2019-10-28) 65 HKD for one way and one cannot purchase round-trip ticket.
https://www.nextstophongkong.com/how-to-get-to-macau (mirror) gives you some additional details, including how to reach the HZMB (Hong Kong–Zhuhai–Macau Bridge) Hong Kong Port:
Here is the machine to buy a shuttle bus ticket to Macau with an Octopus card at the HZMB (Hong Kong–Zhuhai–Macau Bridge) Hong Kong Port:.
The same machine is available in the HZMB Macau Port.
(FYI: Is there any Add Value Machine for Octopus at HZMB (Hong Kong–Zhuhai–Macau Bridge) Hong Kong Port?)
You can otherwise queue to some counter to purchase the shuttle bus ticket to Macau with a different means of payment.
Another interesting source of information: How do I use the Hong Kong-Zhuhai-Macao (HKZM) bridge?