Draw a Dotted (Dashed) Line in Photoshop
Photoshop’s stroke options make it easy to draw dotted or dashed lines. You’ll set up the Pen Tool in Shape mode, apply a dashed stroke, customize the style, and create both straight and curved dashed lines.

Step-by-step instructions
Set up the Pen Tool in Shape mode
Select the Pen Tool (P).
In the options bar, set Tool Mode to Shape.
Set Fill to None and Stroke to your desired color (e.g., black).
Draw a straight line
Click once to place the first point, then click again to place the second point for a straight segment.
In the options bar, set the Stroke Weight to 15 px (or your preferred thickness).
Enable and customize the dashed stroke
In the options bar, click the Stroke style box.
Choose a dashed line preset.
Click More Options.
Set Cap to Round for rounded dots/dashes and choose Align (Inside/Center/Outside) as needed.
Customize Dash to 2 and Gap to 4 (or any values you like), then click OK.
Change stroke color (optional)
Click the Stroke color swatch in the options bar.
Pick a new color (e.g., red or white) and click OK.
Create a curved dashed line
Press Enter/Return to commit the current shape.
With the Pen Tool, click to add a new point, then click-and-drag to add a curved point with handles.
Add additional click-and-drag points to build your curve.
Press Enter/Return to finish the path; the dashed style is applied automatically.