How can I prevent flooding in my house when it rains heavily?
I am assuming you mean water is getting into your basement and the sidewalk connects to your foundation. My First step would be to try and seal where the sidewalk touches to foundation. There is probably a crack there where the water is getting in.  The best sealant would come in a caulk tube make sure it is flexible and made for concrete. Do not get the cheapest stuff at the store.  It may or may not work but for $10 its worth a try. A picture would help us give a better answer.