Place your HTML code in a file and save it as FileName.ASPX, and then you can use the Embed web part to display its contents. Alternatively, you can use the Modern script editor web part to add HTML/JavaScript/CSS code to your modern Sharepoint Online pages.