I have some problems understanding what commands I need for this task. If anyone can help I will be very thankful!
The Arduino sketch should sample an analog input as often as possible! It shall filter the analog input for high-frequency noise (using e.g. a running mean) :o Every 10 seconds it should print a serial message with the current filtered input mapped to voltage. The filtered input to the full range of a PWM output shall be mapped!
What is it you're actually trying to do? The (by default) 500 Hz PWM output is going to be much slower than the ADC.
Depending on your application, a running mean filter is probably not the best idea.
The datasheet of the ATmega328P has a good explanation of how the ADC works (different modes, speeds, triggers), and how the timers are configured for PWM output. I'd recommend you read those sections first if you want to get the most out of your microcontroller.
You should also attempt to achieve your codes by yourself and when you get stuck, post your code and people will help. It's a much better approach than crossing one's fingers.
This sounds like school work.
If the output is to appear only every 10 seconds, then the input could be expected to be a PWM signal with a fairly constant duty cycle.
The “as often as possible” sample rate requirement could mean that you are expected to drive the ADC by a timer and not simply use analogRead() in a loop, but that is then programming at quite an advanced level. What processor are you using ?
The filtering could be simply ignoring short term transitions in the input signal, or if the input is expected to be clean PWM signal, ignoring those inputs which fall outside a certain voltage tolerance.