No, going to the gym is not necessary. You may perform a lot of efficient exercises at home with very little equipment. Look for things to do that you enjoy, like yoga, bodyweight exercises, or running.