Use State Processors and Providers on API Platform 3

How to create custom state processors and providers using API Platform 3.