They are many different techniques available for doing that but the easiest one to useis the Resistive Voltage Divider (RVD). Very crude but effective, with the right quality and precision resistors.
A RVD (also known as a potential divider) is a passive linear circuit that produces an output voltage (Vout) that is a fraction of its input voltage (Vin). Voltage division is the result of distributing the input voltage among the components of the divider.

Let's find out what resistor values we will need for our RVD:
Vinmax = 5V
Voutmax = VADCin_max = 1V
Vout=Vin*R2/(R1+R2)
From the resistor ratio calculation values are: R1=40K and R2=10k. You can choose also other values as long as you keep accurate the ratio between, better go upper that that. 400k and 100k should give the same result for example but be careful with the input impedance! As a general practice a Op Amp Buffer will be a good add-on.
Related article : ESP8266 Internal ADC Explained
And an example of a buffered input ADC input Voltage Level Shifter and amplifier module
Available on Tindie: https://www.tindie.com/products/nEXT_EVO1/universal-ac-mains-dimmer-mpdmv41/