If you go when lots of people are visiting the gym, you risk exposing yourself to more germs.
Many people who work out in gyms hold down a job during the day and may try to fit in the workouts before work or after work, so avoid those times.
For example, people may cough or sneeze on you or you could otherwise transfer germs to your clothes as you use gym equipment.
For example, your gym might offer virtual classes, you can use home exercise equipment or you can go for a walk or run.
Make sure you have hand sanitizer or disinfecting wipes with the proper levels of active ingredients in your gym bag.