Here is a pretty easy way to do it. Estimate your 1RM just by guessing or using a conversion chart or going 5 lbs above your old max. Base these numbers off that lift
Set 1 - 8 reps of ~30-50% 1RM
Set 2 - 5 reps of ~60% 1RM
Set 3 - 3 reps of ~70% 1RM
Set 4 - 1 rep of ~80% 1RM
Set 5 - 1 rep of ~90% 1RM (first set to feel heavy)
Set 6 - 1 rep of ~100% 1RM (attempt max)
Take plenty of rest, several minutes or more as the weights get heavier
The jumps in weight should stay the same or decrease each set, not increase or be erratic. This prepares the body to lift heavier. For example 95, 135, 165, 195 is okay but 95, 115, 175, 195 is not because the huge jump from 115 to 175 lbs
Max sure your last warm-up is no heavier than 90% or so of your 1RM, otherwise you will get tired. For example if I thought my max was 300 it would not be a good idea to do 290 or 295 before that, it is too heavy and will begin to tire me out. The goal is to be warmed up (physically and nervous system wise), without being fatigued.
Once you get your max, if you want to go and try another one go up 5-20 lbs for upper body, lower weight stuff and go up 10-40 lbs for lower body, heavy weight stuff. Too large of a jump and you risk not finding out what your max really is, too small of a jump and it will tire you out before you reach your real max.
If you are going for a new PR in something my suggestion is to break that by the smallest amount possible first, 5 no more than 10 lbs, and then if you get that try a heavier set. I see a lot of people who are hopeful they will really increase their max and then they miss it and get tired and frustrated and often once you miss your day is done. For example, if you benched 200 before and think you might be able to do 220-225, don’t go for that as your max. Do 205, that way worst case scenario is you walk out with a new max, then if rock 205 go for 225 or something. But if you go right for 225 and struggle with it and miss it, then you try 215 and miss that because you are tired, you wasted the opportunity to find out what your max really is.
The stronger you are the more important a good warm-up is, ie it is more important to warm up well for a 400 lb bench then a 95 lb bench, and the 400 lb bench will require more sets. Also everybody is a little different when it comes to warming up and some people like to be very warm, basically sweating, and others like to be very fresh, but the biggest thing people forget is you are warming up your nervous system as well as the body and you do that by practice. It is reps, not sets, that you tire you out so doing a decent number of sets with low reps should be a good system.
Hope that is clear and helpful. Good luck with it.