I purchased new washer and dryer and the breakers for them are tripping after using dryer
Up-sizing the breaker will only work if the right size wires are used. Adding a larger breaker will allow it more breathing room so as not to trip, but if the wires aren't sized right then it'll just burn them up (without tripping) and lead to a fire hazard.

You'd want to have #10 wires ran for a 30A breaker. As long as they are, there'll be no problem.

I'll say though, typically a dryer uses a 30A breaker to begin with and it's odd that Both breakers are tripping when the dryer runs. Your washer circuit should have no influence from the dryer's.