How public key is calculated from a base58 encoded private key?
The private key is just the 32B entropy you generated. Between wallets this private key can be encoded in a format, which provides further information such as the network(main/test/alt) and whether a compressed or uncompressed public key was used. This encoding is called the Wallet Import Format.


version (1B) (0x80 mainnet/0xEF testnet)
privatekey (32B)
0x01 compressionmarker (1B)
checksum (4B)


https://teachbitcoin.io/wallets.html#/2

Checksum is of everything which precedes it. The data is finally encoded in base58.

To take this WIF data and produce the public key, the wallet just needs to extract the private key 32B) and compute the public key point


private_key * Generator_point = public_key(x,y)


The resulting x, y public key point is your public key. If the compression market is on, take the x-coordinate and prepend a 0x02 or 0x03 depending on whether it is even or odd.


compressed public key: 0x02/0x03 + x_coordinate(32B)
uncompressed public key: 0x04 + x_coordinate(32B) + y_coordinate(32B)