How do I best show the format that’s allowed for an input?

I can restrict the input on the front-end to certain values or make it match a regex pattern, but the user might be confused about why they can't input certain values unless it's communicated to them in some way what the input restrictions are.

I could try to add a specific explanation about form fields that seem out of the ordinary as far as their restrictions go, but is there a common pattern that's used to communicate the constraints on an input field? Do I just explain the format in a placeholder for the input? Should I display some formatting message in small text below the input? Is there an established convention for this sort of thing?

For example, if I want to show the valid input formats for password fields or for phone/email inputs how should I do that?