[RESOLVED] I am making a mini soccer game using a power up, soccer ball and blockers

They will just get the player character in any place. And even that will not prevent a nullptr situation. You still have to have guards:

ASoccerGameCharacter* Player = Cast<ASoccerGameCharacter>(UGameplayStatics::GetPlayerCharacter(this, 0));

if (Player)
{
    ...
}
else
{
    UE_LOG(LogTemp, Error, TEXT("Invalid Player"));
}

For the second case:

if (GetWorld())
{
    auto controller = GetWorld()->GetFirstPlayerController();
    if (controller)
    {
       auto Player = Cast<ASoccerGameCharacter>(controller ->GetPawn());
       ....
    }
    else
    {
        UE_LOG(LogTemp, Error, TEXT("Invalid Player controller"));
    }
}
else
{
    UE_LOG(LogTemp, Error, TEXT("Invalid GetWorld"));
}

During development, you should use and abuse safeguards (asserts, pointers checks) and logs (specially for negative outcomes).
The time spent in these are way lesser than having to restart the editor over and over again and in trying to find out the cause of the crash.