Set up 2 user accounts on the second iMac. Make sure both accounts have a password.
- First account should be your Admin account. Do not share this password with anyone.
- Second account should be a regular "User" account for your grandkids to use - no Admin privileges.
Enter your Apple ID in both accounts. This assumes the grandkids do not have their own Apple ID.
- Use your Admin account to purchase, download & install games.
- In the Second account (the User account), UNcheck (disable) all individual iCloud services except Find My Mac.
In Users & Groups you may want to consider setting the Login Option to automatically log in to the User account so that when your grandkids start up the iMac it goes right into their User account.
If/when you use the iMac yourself, use your Admin account and make sure to save files to folders exclusively within your user home folder, typically in your Documents folder.
When logged into their User account, your grandkids will have no access to any files, folders or other data that is in your own user home folder.
You may also want to consider setting some Content & Privacy Restrictions on the User account. Follow the instructions in this guide -> Set up content and privacy restrictions in Screen Time on Mac - Apple Support