When your 2018 BMW 3 Series displays the P0305 code, the diagnostic approach depends on your engine. The 2018 3 Series (F30 generation final year) offered four-cylinder and inline-six options. P0305 is valid on 340i's inline-six but anomalous on 320i/330i four-cylinders.
2018 3 Series Engine Options
The F30 2018 3 Series offered the 2.0L N20/B48 turbo I-4 and the 3.0L N55 or B58 turbo I-6 (340i). Only the inline-six has cylinder 5.
Inline-Six Diagnosis
At 2018 mileage levels, spark plug wear is common if not serviced. Ignition coils can fail. Carbon buildup on direct-injection engines is a known issue requiring cleaning.
Four-Cylinder Models
320i and 330i models have four-cylinder engines where P0305 is anomalous.
Diagnostic Steps
Identify your engine. On 340i, inspect spark plugs and ignition coils at cylinder 5. Consider carbon cleaning at higher mileages.