Get /create yourself a table ?with 1 dBm steps and power and voltage (at 50ohms) columns?
Start writing all the examples you can find on it to get used to the respective power levels and also input capabilities
Counting down the row difference between the source and your input capability tells you how many dB attenuation you need
Checking the power column difference tells you the minimum attenuator power handling you need?
?