The first thing to do is to remain calm. Panicking can make the situation worse and might even prolong the erection.