It's not a major issue for your next tax declaration. If your employer doesn't provide year-end payslips, request a certificate confirming the income you've declared. However, it can complicate retirement calculations, so replacing them is advisable.
Contact your employer's HR department. Payslips are archived, so they can issue duplicates or a certificate summarizing your annual salaries. If you've worked for multiple companies, submit requests to each one.
You can't retrieve payslips directly, but contact your pension fund—CARSAT in most regions or CNAV in Île-de-France for general scheme employees. Provide the former employer's name and address, plus a work certificate if available. After 3-4 weeks of archive research, you'll receive a career statement detailing your gross salaries and old-age insurance contributions.