Replacing a bath fan is a simple project on the surface, but it can get complicated for various reasons. It involves mounting, wiring, and ducting.
When purchasing a replacement unit, physical size is one consideration, but more important are sound level (sones) and air movement capacity (CFM) of the new fan. Most will tell you on the package what room size they're suited for. These fans are designed for use in bathrooms, so there's no special rating for that purpose.
If you're replacing an entire unit, you may need to slightly enlarge the opening in your ceiling or wall, but that's usually not an overwhelming challenge. This applies to box units, not in-duct units such as are common in the UK and elsewhere.
Where it can get tricky is in mounting the new fan. Ideally, you have attic access, from which you can disconnect and remove the existing fan, mount and connect the new one, and repair any disturbed insulation and vapor barrier.
Another possible issue is ducting. If the new fan has its outlet in a different position, or is a different size, you may need to move or alter the duct. Many are flexible, so then it's a matter of adequate length.
I suggest that you purchase a fan kit, read the directions completely, then make an assessment as to your ability to complete the project. You can always return the fan and hire someone to do the job.