Other things: be sure to drink early and often. Be sure to always take at least 1 water bottle on your bike with you. In hot weather, you can get heat exhaustion quickly. Do a search and be able to recognize the symptoms.
Other things, it is not a bad thing to get off the bike and rest for a few minutes especially if you are getting pain in the contact points: rear, feet or hands.
It is also not a bad thing if you have to walk a hill. It is better to walk a hill and be able to finish the ride feeling reasonably good than climbing the hill and beating yourself up so badly that you wish you hadn't.
Another thing, do not go by no pain/ no gain on every ride. I have seen people do that and they don't stay riding long. Why do something that always hurts? If you do a hard day, take it easy the next day.
There are a bunch of different ways to ride a bike and enjoy it. Some people love to go fast and hammer. Other people just poke along, chat with their friends and enjoy the scenery. Other people just ride trails. There is no single "right way" to ride a bike. Some people will tell you different but don't believe them.
Here is another point. Any exercise you do, does you a bunch more good than the perfect way of doing it that you won't do. The important thing is getting out and riding however you ride (assuming that you proceed in a safe manner).