How To Create Randomized Rooms

Hi yall, hope your having a splendid day/night. However, I have been trying to make randomized rooms that connect to each other as they generate. Can somebody potentially help me with this? I run on version 1.19.4.