Hi mrsmoore112
Welcome to the Apple Community.
Congratulations on the new iMac!
You might want to check the keyboard settings in case some settings are not what they need to be.
Eg: may be something has been accidently altered, or an unwanted setting triggered
iMac Magic Keyboard – Apple Support
And: Set how quickly a key repeats on Mac - Apple Support
Also: Apple menu > System Preferences, > Accessibility > Keyboard,
____________________________________________________________
More info:
Online article: with a possible fix for repeating keys on bluetooth keyboard:
https://forums.macrumors.com/threads/how-to-fix-a-bluetooth-keyboard-that-is-repeating-keys.1823520/
Another possibility: Resolve Wi-Fi and Bluetooth issues caused by wireless interference - Apple Support
___________________________________________________________________
If nothing here has helped:
You might want check out the "under warranty" or other support available from Apple:
iMac Support Team
There is a "Get Support" link at the bottom of their website (link below)
iMac - Official Apple Support:
One stop for technical support, Apple hardware service, and software support.
Call Apple Support at 1-800-APLCARE (or use the app)
AppleCare Products - Apple
All the best :-)