Frozen car door on a '99 Toyota Corolla

I live in Minnesota and recently it rained and froze one night. I couldn’t open my door from the outside so I crawled in through the passenger side door and opened it from the inside. It opened but then would not shut. The door latch was in the locked position and would not move. I drove it home for Thanksgiving using straps to keep the door mostly shut and when I got to my parents house, parked it in their heated garage and the problem was solved. Unfortunately this happened again a few nights ago when I tried to drive a friend home. How can I prevent this from happening as I assume water from melted snow/rain is leaking into the door and freezing inside.

Look at the condition of the seal at the bottom of the window. If it’s damaged it’ll allow water/snow inside the door freezing the door mechanism. If the seal appears to be good, then the window may need to be adjusted out so it sits tighter against the seal.