In recent years, the rapid development of artificial intelligence algorithms has promoted the intelligent transformation of the ship industry; unmanned surface vessels (USVs) have become a widely used representative product. The dynamic window approach (DWA) is an effective robotic collision avoidance algorithm; however, there are deficiencies in its application to the ship field. First, the DWA algorithm does not consider International Regulations for Preventing Collisions at Sea (COLREGs), which must be met for ship collision avoidance to ensure the navigational safety of the USV and other ships. Second, the DWA algorithm does not consider the influence of wind and waves on the collision avoidance of USVs in actual navigational environments. Reasonable use of windy and wavy environments not only improves navigational safety but also saves navigational time and fuel consumption, thereby improving the economy. Therefore, this paper proposes an improvement algorithm by DWA referred to as utility DWA (UDWA) based on COLREGs considering the sailing environment. The velocity sampling area was improved by dividing the priority, and the velocity function in the objective function was enhanced to convert the effect of wind and waves on the USVs into a change in velocity. The simulation results showed that the UDWA algorithm optimized the distance to the obstacle ship by 43.25%, 31.36%, and 67.81% in a head-on situation, crossing situation, and overtaking situation, respectively, compared to the COLREGs-compliant DWA algorithm, which considers the COLREGs. The improved algorithm not only follows the COLREGs but also has better flexibility in emergency collision avoidance and can safely and economically navigate and complete collision avoidance in windy and wavy environments.