While EIP-2537 (featuring BLS12-381) has not been approved nor finalized yet, you can emulate an Ethereumrun a private network fork supporting it with a service like EspressoSys, or instantiate a private network containing this precompile any other waythat precompile.
In addition to that, there's a greatnice GitHub Solidity library (although this library is originally intended to test the Celo proposals, but the code shouldn't differ on Ethereum) that brings some helpers forexamples of using BLS12-381 operations in Solidity smart contracts (which is a wrapper around EIP-2537).
It does though warn you too that:
These EIPs are not active on mainnet at time of writing, and require specialized client software to execute.