It would be helpful to know what model iMac you have, what OS it is running, and whether the issue started occurring after you made any software or hardware changes.
When I am faced with a similar black screen situation and the system sounds like it may be booting I do the following:
Wait until the system sounds like it has finished booting, then press the Caps Lock key and see if the green LED turns ON. If it does, you know that the system is booting the OS. The system either doesn't see the display (internal connection issue or a hardware issue), the display has a fault, or the display is displaying an image but the backlight isn't turning on to light up the display.
Try resetting the NVRAM first to see if it clears the issue:
How to reset NVRAM or PRAM on your Mac - Apple Support
Next, check to see if the display backlights are not lighting up. First boot the system and confirm that the Caps Lock key lights up indicating that the OS booted. Shine a bright light (LED flashlight works great) on the display and look closely for signs that the display is displaying the login window or other things that you would expect to see on your iMac when it boots. The images will be very faint, so look closely. If you see images then this indicates that the display is working, but the backlight isn't turning on. You'll need to take it in for service.
If you see no image at all and you have another external display you can try, then connect the external display and see if video appears. If it does then you probably have a bad display or display connection and will need to take it in for service.
Good luck.